Created
January 18, 2017 03:59
-
-
Save jfsiii/2e09e5716d0a69df730cbfe406ce366c to your computer and use it in GitHub Desktop.
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
plugins: [ | |
// put all npm modules in the 'vendor' chunk | |
// matches react modules too, but they'll be moved by the next entry | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'vendor', | |
minChunks: (module) => npmModuleRegex.test(module.resource) | |
}), | |
// put all key react modules in 'react' chunk | |
// they're ~140KB (~40KB gz) and don't change often | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'react', | |
minChunks: (module) => reactModuleRegex.test(module.resource) | |
}), | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'common', | |
names: [ 'manifest' ] // manifest is the code require to load other chunks | |
}), | |
... | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment