方法一:
entry: {
index: './src/index.js',
another: './src/main.js'
},
optimization: {
splitChunks: {
chunks: 'all'
}
}
方法二:
entry: {
// 方法一
// 将多入口文件的lodash单独打包成shared.bundle.js
index: {
import: './src/index.js',
dependOn: 'shared'
},
another: {
import: './src/main.js',
dependOn: 'shared'
},
shared: 'lodash'
},