“webpack”: “^5.72.0” 报错:
/Users/guojianbo/Documents/xxx/node_modules/webpack/lib/ChunkGroup.js:119
throw new Error(
^
Error: ChunkGroup.addOptions: No option merge strategy for name
at Entrypoint.addOptions (/Users/guojianbo/Documents/xxx/node_modules/webpack/lib/ChunkGroup.js:119:12)
解决方法:
webpack.config.js
修改前:
module.exports = {
entry: {
'abc-def': "./src/js/abc-def.js",
'qwe-rty': "./src/js/qwe-rty.js",
}
}
修改后
module.exports = {
entry: {
'my-abc-def': "./src/js/abc-def.js",
'my-qwe-rty': "./src/js/qwe-rty.js",
}
}
也就是给 entry 名加一个前缀,以防和 webpack 打包内部 chunk 名字冲突