Skip to content

Instantly share code, notes, and snippets.

Asset Size Chunks Chunk Names
main.cec87b856171489c2719.js 811 bytes 0 [emitted] main
vendor.73db375ed475c718163f.js 20.7 kB 1 [emitted] vendor
runtime.93b41beba42ebff23af0.js 5.92 kB 2 [emitted] runtime
[0] ./~/preact/dist/preact.js 20.5 kB {1} [built]
[1] ./src/bar.js 23 bytes {0} [built]
[2] ./src/foo.js 118 bytes {0} [built]
[3] multi preact 28 bytes {1} [built]
// foo.js
import bar from './bar';
// ...
Asset Size Chunks Chunk Names
vendor.634878b098e5c599febd.js 20.7 kB 0 [emitted] vendor
main.d59c6ff3126e3943c563.js 538 bytes 1 [emitted] main
runtime.25ce0c546aab71f8eac5.js 5.92 kB 2 [emitted] runtime
[0] ./~/preact/dist/preact.js 20.5 kB {0} [built]
[1] ./src/foo.js 93 bytes {1} [built]
[2] multi preact 28 bytes {0} [built]
// webpack.config.js
// ...
plugins: [
// ...
new webpack.optimize.CommonsChunkPlugin({
name: ['runtime']
})
]
// somewhere in the vendor.0da51f051fcf235d7027.js
// ...
chunkId + "." + {"0":"91022729b32987083f0d"}[chunkId]
// ...
Asset Size Chunks Chunk Names
main.91022729b32987083f0d.js 506 bytes 0 [emitted] main
vendor.0da51f051fcf235d7027.js 26.7 kB 1 [emitted] vendor
[0] ./~/preact/dist/preact.js 20.5 kB {1} [built]
[1] ./src/foo.js 61 bytes {0} [built]
[2] multi preact 28 bytes {1} [built]
// foo.js
// ...
console.log(preact.toString());
console.log("hello world");
Asset Size Chunks Chunk Names
main.edc22f71759cbe5336ae.js 528 bytes 0 [emitted] main
vendor.27f1230219fd2a606a54.js 26.7 kB 1 [emitted] vendor
[0] ./~/preact/dist/preact.js 20.5 kB {1} [built]
[1] ./src/foo.js 83 bytes {0} [built]
[2] multi preact 28 bytes {1} [built]
// webpack.config.js
// ...
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].[chunkhash].js',
},
// ...
Asset Size Chunks Chunk Names
main.423221edd7eef26d646e.js 506 bytes 0 [emitted] main
vendor.423221edd7eef26d646e.js 26.7 kB 1 [emitted] vendor
[0] ./~/preact/dist/preact.js 20.5 kB {1} [built]
[1] ./src/foo.js 61 bytes {0} [built]
[2] multi preact 28 bytes {1} [built]