webpack-code-splitting-demo icon indicating copy to clipboard operation
webpack-code-splitting-demo copied to clipboard

webpack code splitting & long term cache

webpack-code-splitting-demo

A vue.js demo 4 webpack code splitting,

and long term cache demo in cache branch.

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

Tutorial

Webpack 大法之 Code Splitting.

Steps:

  1. Init project
  2. Init app
  3. Set 'vendor' entry
  4. Set up CommonsChunkPlugin
  5. Automatically splitting vendor
  6. Add router
  7. Dynamic import router components
  8. + async flag
  9. count in minChunks