happyPack报错:HappyPack: unable to locate the plugin list! This most likely indicates an internal error.
原代码:
configureWebpack: config => {
//happypack - js 局部
config.module.rules.push({
test: /\.js$/,
loader: 'happypack/loader?id=happyBabel',
})
config.plugins.push(new HappyPack({
id: 'happyBabel',
loaders: [{
loader: 'babel-loader?cacheDirectory=true',
}],
threadPool: happyThreadPool,
//容许 HappyPack 输入日志
verbose: true,
})
}
尝试后发现应该是js的rule局部有问题,去掉下面写在configureWebpack中的rule局部,批改为在chainWebpack中革除js的rule规定后,再进行happypack配置。
批改后代码:
//happyPack - js 局部
chainWebpack: config => {
const jsRule = config.module.rule('js');
jsRule.uses.clear();
jsRule.use('happypack/loader?id=happyBabel')
.loader('happypack/loader?id=happyBabel')
.end();
}
configureWebpack: config => {
//happypack - js 局部
config.plugins.push(new HappyPack({
id: 'happyBabel',
loaders: [{
loader: 'babel-loader?cacheDirectory=true',
}],
threadPool: happyThreadPool,
//容许 HappyPack 输入日志
verbose: true,
})
}
发表回复