//build.js 升级版 多进程 编译所有 //parallel-webpack允许您并行运行多个Webpack构建,从而将工作分散到各个处理器上,从而有助于显着加快构建速度 let moduleList = (process.argv[2] || "").replace(/\s*$/g, ""); var run = require('parallel-webpack').run, configPath = require.resolve('./webpack.config.js'), options = { watch: false, maxRetries: 1, stats: false, // defaults to false maxConcurrentWorkers: 2 ,// use 2 workers argv:[moduleList] }; function notify(res) { // do things // if(res&&res.message){ // console.log('\n',res.message,'\n'); // } console.log(new Date(),'--------------- \n'); } // require('./copyBaseAssets'); run(configPath, options, notify);