Created
April 2, 2018 14:54
-
-
Save shelldandy/2efca1a411404388e6ecf73fccb8b772 to your computer and use it in GitHub Desktop.
Update webpack 3 to 4 with separate vendors of node_modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// ... | |
optimization: { | |
splitChunks: { | |
cacheGroups: { | |
commons: { | |
test: /[\\/]node_modules[\\/]/, | |
name: 'vendor', | |
chunks: 'initial', | |
}, | |
}, | |
}, | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!