1 error in child compilations webpack 5
·
出现这个错误原因可能是有很多,但该错误并不会打印出错误的堆栈信息。
[webpack-cli] Compilation finished
assets by status 15 bytes [cached] 1 asset
./temp.js 14 bytes [built] [code generated]
1 ERROR in child compilations
webpack 5.10.2 compiled with 1 error in 298 ms
这让人情何以堪?
我尝试自己写插件捕获错误日志,或者配置参数
module.exports = {
//...
stats: {
errors: false
}
};
均无果,后来逐一调试,发现是html-webpack-plugin报错了。
可以尝试不给html-webpack-plugin传参,看是否能打包成功。比如下面这样
new HtmlWebpackPlugin({
template: './index.html'
}),
最好配置一个index.html文件,因为好像中间过程使用了ejs,但并没有相关的loader导致报错。
更多推荐

所有评论(0)