且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Npm postinstall 仅用于开发

更新时间:2022-03-10 23:41:55

较新的 npm (& Yarn) 版本包括对在每个 install之后运行的 prepare 脚本的支持> 运行但仅在开发模式下.此外,prepublish 已被弃用.这应该足够了:

Newer npm (& Yarn) versions include support for the prepare script that is run after each install run but only in development mode. Also, the prepublish is deprecated. This should be enough:

{
  scripts: {
    "prepare": "bower install"
  }
}

文档:https://docs.npmjs.com/misc/scripts