Make common chunk (and sourcemap) work

This commit is contained in:
ahocevar
2018-06-08 12:57:38 +02:00
parent f8abb5def1
commit 649b7be4c2

View File

@@ -19,8 +19,12 @@ module.exports = {
target: 'web', target: 'web',
entry: entry, entry: entry,
optimization: { optimization: {
runtimeChunk: {
name: 'common'
},
splitChunks: { splitChunks: {
name: 'common', // TODO: figure out why this isn't working name: 'common',
chunks: 'initial',
minChunks: 2 minChunks: 2
} }
}, },
@@ -37,8 +41,7 @@ module.exports = {
{from: 'index.html', to: 'index.html'} {from: 'index.html', to: 'index.html'}
]) ])
], ],
// TODO: figure out why this hangs devtool: 'source-map',
// devtool: 'source-map',
output: { output: {
filename: '[name].js', filename: '[name].js',
path: path.join(__dirname, '..', '..', 'build', 'examples') path: path.join(__dirname, '..', '..', 'build', 'examples')