【发布时间】:2021-10-04 04:11:07
【问题描述】:
我正在尝试在从 git 安装后构建一个 npm 包。
为了构建包,我还需要安装开发依赖项。该包是使用 webpack 构建的,我已将 webpack 列为开发依赖项。
我已经尝试按照以下方式设置--production=false
package.json of the package that im trying to install
{
// rest of the package.json
"scripts": {
"build": "webpack",
"install": "npm install --production=false",
"postinstall": "npm run build"
}
}
我可以看到在install 脚本中再次运行npm install 是愚蠢的。
我现在可以尝试只设置--production=false,但我想我必须再次将其设置回--production=true,并且并行安装的依赖项会怎样,这个标志也会影响那些吗?
还有其他方法可以实现吗?
【问题讨论】:
标签: npm npm-install