package.json的script中的几个钩子


scripts: 声明一系列npm脚本指令

  1. prepublish: 在包发布之前运行,也会在npm install安装到本地时运行
  2. publish,postpublish: 包被发布之后运行
  3. preinstall: 包被安装前运行
  4. install,postinstall: 包被安装后运行
  5. preuninstall,uninstall: 包被卸载前运行
  6. postuninstall: 包被卸载后运行
  7. preversion: bump包版本前运行
  8. postversion: bump包版本后运行
  9. pretest,test,posttest: 通过npm test命令运行
  10. prestop,stop,poststop: 通过npm stop命令运行
  11. prestart,start,poststart: 通过npm start命令运行
  12. prerestart,restart,postrestart: 通过npm restart运行


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM