在我的节点模块中,我在源代码中使用了更大的库,这需要一段时间来编译。我相信这与node-gyp默认使用的--no-parallel
设置有关。现在我想知道是否可以并行创建node-gyp编译cpp文件来加速这个过程。我找不到任何对GYP format reference page有帮助的东西。是否有我的项目gyp文件的设置或者node-gyp的hack?
答案 0 :(得分:8)
查看the code,这可能也有效:
$ env JOBS=8 npm install ...
答案 1 :(得分:4)
只需将其添加到package.json文件中:
"scripts": {
"install": "node-gyp rebuild -j 8"
},