webpack-4 optimizations
This playground project is based on webpack-splitchunks-playground
Webpack 4 optimization.splitChunks
playground…
webpack 4 removes the
CommonsChunkPlugin
in favor of two new options (optimization.splitChunks
andoptimization.runtimeChunk
)
src
├── bundles
│ ├── a.js
│ ├── b.js
│ ├── core-a.js
│ └── core-b.js
├── core-module-a.js
├── core-module-b.js
├── non-core-module-a.js
└── non-core-module-b.js
webpack.config.entry.js
to specify entypointsbash
npm run build:entry
Hash: 09cb46e3e80b0d3d7bba
Version: webpack 4.1.1
Time: 98ms
Built at: 3/11/2018 11:44:49 PM
Asset Size Chunks Chunk Names
coreA.bundle.js 3.62 KiB 0 [emitted] coreA
coreB.bundle.js 3.64 KiB 1 [emitted] coreB
a.bundle.js 4.33 KiB 2 [emitted] a
b.bundle.js 4.35 KiB 3 [emitted] b
Entrypoint coreA = coreA.bundle.js
Entrypoint coreB = coreB.bundle.js
Entrypoint a = a.bundle.js
Entrypoint b = b.bundle.js
webpack.config.js
(configure optimization
property)bash
npm run build
MIT © Carloluis