我的PC端的vue项目打包上线之后 控制台报ReferenceError: webpackJsonp is not defined错误 之前都没这个问题 今天就现出了
不太明白JSONP不是跨域用的吗 我没有用到跨域 查了一下 说是用了CommonsChunkPlugin的问题 说是生成了公共文件但是没有在页面引入 看了关于也没有看明白是在哪个页面引入哪个公共文件
这是webpack.prod.conf.js文件的代码 我这是生成了哪个公共文件呀
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
}),
这是打包之后的文件 应该不是在打包之后的index.html里引入吧 这里的代码都是压缩过的
是在项目根目录下的index.html引入吗 是哪个公共文件呢