Skip to content

Instantly share code, notes, and snippets.

@evenstensberg
Last active April 3, 2020 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evenstensberg/b2b1a502718f5dc7af7d8e2933483f20 to your computer and use it in GitHub Desktop.
Save evenstensberg/b2b1a502718f5dc7af7d8e2933483f20 to your computer and use it in GitHub Desktop.
Example Chunk Splitting Strategy
module.exports = {
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
name: 'vendor',
test: /[\\/]node_modules[\\/]/,
chunks: 'all',
maxSize: 500000
},
styles: {
name: 'styles',
test: /\.css$/,
chunks: 'all'
}
}
},
runtimeChunk: true,
sideEffects: true
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment