var webpack = require('webpack')
var path = require('path')
module.exports = {
entry: {
'pageA': './src/pageA',
'pageB': './src/pageB',
'vendor': ['lodash']
},
output: {
path: path.resolve(__dirname, './dist'),
publicPath: './dist/',
filename: '[name].bundle.js',
chunkFilename: '[name].chunk.js'
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: ['vendor', 'manifest'],
minChunks: Infinity
}),
new webpack.optimize.CommonsChunkPlugin({
async: 'async-common',
children: true,
minChunks: 2
})
]
}
index.html引入后报错
pageA.bundle.js:1 Uncaught ReferenceError: webpackJsonp is not defined
at pageA.bundle.js:1
登录后可查看更多问答,登录/注册