/webpack-scp-demo

The final version of the example highlighted in an article by Uday Hiwarale from ITNext on Medium

Primary LanguageJavaScript

Webpack 4 Code Splitting using SplitChunksPlugin

The final version of the example highlighted in this fantastic article on Medium by Uday Hiwarale from ITNext.

Instructions

  1. yarn to install dependencies
  2. Execute command yarn start for running development server and preview
  3. See network tab of console for what chunks are loaded (sync and async)

Chunks

Defined in webpack.config.js.

  • vendor: Anything in node_modules (sync)
  • common: Any import shared between 2 or more components (sync)
  • main: Everything else required at runtime (sync)
  • dynamic imports: 1 per page route (async)

Credits