[NPM] Publish npm packages using npm publish
npm Using Packages Publish
2023-09-14 08:59:18 时间
In this lesson we will publish our package. We will first add a prepublish
script that runs our build
script; 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.
相关文章
- hexo-butterfly-npm标签插件开发
- npm入门使用介绍
- npm缺少css-loader,/style-compiler,stylus-loader问题,npm没有权限无法全局更新问题
- “NPM”的全称(github.com/npm/npm-expansions)
- 在npm安装vue-router报错npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve
- npm、cnpm安装「建议收藏」
- 跑 npm scripts,其实有更香的方式
- npm install 报错 error code ERR_SOCKET_TIMEOUT解决办法
- 如何规范地发布一个现代化的 NPM 包?
- npm run 是什么?为什么使用npm run 这一命令,就能够将 webpack 跑起来并进行下一步的操作?
- 如何发布一个 TypeScript 编写的 npm 包
- pm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! Whil
- Mac npm install permission denied
- Linux上安装及使用NPM(linuxnpm)
- 利用MySQL中的Using进行优化查询(mysql 中using)