Skip to content

Instantly share code, notes, and snippets.

@thescientist13
Last active May 4, 2018 20:12
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 thescientist13/796501d750b35fc1213ed6ec2052390b to your computer and use it in GitHub Desktop.
Save thescientist13/796501d750b35fc1213ed6ec2052390b to your computer and use it in GitHub Desktop.
webpack optimization API configuration
optimization: {
minimizer: [
new UglifyJsWebpackPlugin(),
new OptimizeCssAssetsPlugin({
cssProcessorOptions: { discardComments: { removeAll: true } }
})
],
splitChunks: {
chunks: 'all',
cacheGroups: {
styles: {
name: 'bundle',
test: /\.(css|scss)$/,
chunks: 'all',
enforce: true
}
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment