码迷,mamicode.com
首页 > 其他好文 > 详细

[NPM] Publish npm packages using npm publish

时间:2017-09-29 10:00:30      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:wan   ignore   ref   published   lis   href   only   http   script   

In this lesson we will publish our package. We will first add a prepublish script that runs our buildscript; this will ensure the built folder gets added to npm when published. We will also add a .npmignore so that only our built files get installed. We need to run npm adduser to log in to an npm account. We can then run npm publish to publish our package and view it on npm.

Note: if you want to actually publish the package from this course, you‘ll need to rename it since sensitive-words is already taken. You can use a scoped package name for this as well.

 

Inside our .npmigore:

src // ignore, therefore users install our package will not include src folder

 

script:

"prepublish": "npm run build",

Add prepublish script, so that everytime we publish the lib, will make sure use the latest code.

[NPM] Publish npm packages using npm publish

标签:wan   ignore   ref   published   lis   href   only   http   script   

原文地址:http://www.cnblogs.com/Answer1215/p/7609291.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!