Skip to content

Instantly share code, notes, and snippets.

@AndrewSouthpaw
Created June 26, 2017 16:49
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 AndrewSouthpaw/81e720deda025ef128dc65cbc40e3e7f to your computer and use it in GitHub Desktop.
Save AndrewSouthpaw/81e720deda025ef128dc65cbc40e3e7f to your computer and use it in GitHub Desktop.
Trying to use explicit vendor chunks.
// foobar.js
import _ from 'lodash'
console.log(_.map([1, 2, 3], x => x + 1))
// webpack.config.js
// ...snip...
entry: {
common: ['lodash'],
'foobar': './foobar.js',
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'common',
minSize: Infinity,
}),
]
// ...snip...
// Output
Version: webpack 2.6.1
Time: 2369ms
Asset Size Chunks Chunk Names
foobar.js 2.29 MB 0 [emitted] [big] foobar
common.js 2.29 MB 1 [emitted] [big] common
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment