Skip to content

Instantly share code, notes, and snippets.

@shelldandy
Created April 2, 2018 14:54
Show Gist options
  • Save shelldandy/2efca1a411404388e6ecf73fccb8b772 to your computer and use it in GitHub Desktop.
Save shelldandy/2efca1a411404388e6ecf73fccb8b772 to your computer and use it in GitHub Desktop.
Update webpack 3 to 4 with separate vendors of node_modules
{
// ...
optimization: {
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'initial',
},
},
},
}
// ...
}
@shelldandy
Copy link
Author

Really not ideal its better to do dynamic imports per page or similar, but I know people like their split vendors, so here they are!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment