P E N C I L
Login
Webpack codesplitting
  1. Config
    entry: { main: './index.js', vendor: 'lodash' },
     output: {
        filename: '[name].[chunkhash].js',
        path: path.resolve(__dirname, 'dist')
     }
    1. Bundle is output to output.path=currentdir+/+dist
    2. Bundle file name is [entryName].[chunkhash].js (ex: main.xxx.js, vendor.xxx.js)
    3. main, vendor: are called chunk
  2. CommonChunkPlugin
    new webpack.optimize.CommonsChunkPlugin({ name: 'vendor' // Specify the common bundle's name. })
    1. Extract common chunks in {entry} and write it to "vendor",
      If common chunk is a one of chunk in entry, it appends to that chunk
  3. Output
    [1] ./index.js 275 bytes {0} [built]
    File index.js is written to chunk {0}
    (webpack)/buildin/harmony-module.js 596 bytes {0}
    Bootstrap webpack is stored in entry module {0}. It must be