mirror of
https://github.com/PrismarineJS/prismarine-web-client.git
synced 2025-08-28 21:28:44 -04:00
use chunks in dev
This commit is contained in:
parent
a977441046
commit
c6936407b2
2 changed files with 17 additions and 2 deletions
|
@ -8,7 +8,7 @@ const config = {
|
||||||
entry: path.resolve(__dirname, './index.js'),
|
entry: path.resolve(__dirname, './index.js'),
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, './public'),
|
path: path.resolve(__dirname, './public'),
|
||||||
filename: './index.js',
|
filename: './[name]-[chunkhash].js',
|
||||||
publicPath: './'
|
publicPath: './'
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
|
@ -47,7 +47,8 @@ const config = {
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: 'index.html',
|
template: 'index.html',
|
||||||
hash: true,
|
hash: true,
|
||||||
minify: false
|
minify: false,
|
||||||
|
chunks: ['main', 'vendors'],
|
||||||
}),
|
}),
|
||||||
// fix "process is not defined" error:
|
// fix "process is not defined" error:
|
||||||
new webpack.ProvidePlugin({
|
new webpack.ProvidePlugin({
|
||||||
|
|
|
@ -19,5 +19,19 @@ module.exports = merge(common,
|
||||||
devMiddleware: {
|
devMiddleware: {
|
||||||
writeToDisk: true,
|
writeToDisk: true,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
optimization: {
|
||||||
|
splitChunks: {
|
||||||
|
maxAsyncRequests: 10,
|
||||||
|
maxInitialRequests: 10,
|
||||||
|
cacheGroups: {
|
||||||
|
vendors: {
|
||||||
|
test: /[\\/]node_modules[\\/]/,
|
||||||
|
name: "vendors",
|
||||||
|
priority: 10,
|
||||||
|
chunks: 'all'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue