vue使用npm run build打包后运行报错Uncaught ReferenceError: webpackJsonp is not defined,但在idea中使用npm run dev运行就不会报错
vue使用npm run build打包后运行报错Uncaught ReferenceError: webpackJsonp is not defined,但在idea中使用npm run dev运行就不会报错
解决方法:
vue使用npm run build打包后运行报错Uncaught ReferenceError: webpackJsonp is not defined,但在idea中使用npm run dev运行就不会报错。
我报上面错误时build/webpack.prod.conf.js的配置:
new HtmlWebpackPlugin({
favicon:"src/assets/images/favicon.ico",
filename: 'designer/syssurvey.html',
template: 'src/designer/syssurvey.html',
inject: true,
chunks: ['syssurvey'],
}),
修改后的build/webpack.prod.conf.js文件:
new HtmlWebpackPlugin({
favicon:"src/assets/images/favicon.ico",
filename: 'designer/syssurvey.html',
template: 'src/designer/syssurvey.html',
inject: true,
chunks: ['manifest','vendor','syssurvey'],
minify: {
removeComments: true,
collapseWhitespace: false,
removeAttributeQuotes: false
},
chunksSortMode: 'dependency'
}),