, npm run build package error after upgrading from vue webpack to webpack4
hand disability, upgrade webpack to 4, development environment adjusted, normal operation, production environment, packaging problems, Baidu, google did not find a solution.
report an error as shown in the following figure
webpack.prod.conf.js
changed
optimization: {
runtimeChunk: {
name: "manifest"
},
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: config.build.productionSourceMap,
uglifyOptions: {
warnings: false
}
}),
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
],
splitChunks:{
chunks: "async",
minSize: 30000,
minChunks: 1,
maxAsyncRequests: 5,
maxInitialRequests: 3,
name: false,
cacheGroups: {
vendor: {
name: "vendor",
chunks: "initial",
priority: -10,
reuseExistingChunk: false,
test: /node_modules\/(.*)\.js/
},
styles: {
name: "styles",
test: /\.(scss|css)$/,
chunks: "all",
minChunks: 1,
reuseExistingChunk: true,
enforce: true
}
}
}
},