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,
})
}
版权声明:程序员胖胖胖虎阿 发表于 2022年9月17日 下午5:56。
转载请注明:HappyPack报错记录:HappyPack: unable to locate the plugin list! | 胖虎的工具箱-编程导航
转载请注明:HappyPack报错记录:HappyPack: unable to locate the plugin list! | 胖虎的工具箱-编程导航
相关文章
暂无评论...