Skip to content

Commit e911daf

Browse files
mbsrcskipjack
authored andcommitted
docs(guides): rename 'runtime' to 'manifest' in caching.md (#1713)
Preserve CommonsChunkPlugin boilerplate naming consistency as referenced in the CommonsChunkPlugin documentation (see below) when extracting webpack runtime and manifest boilerplate. https://webpack.js.org/plugins/commons-chunk-plugin#manifest-file
1 parent 968c0d1 commit e911daf

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

src/content/guides/caching.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ __webpack.config.js__
135135
- })
136136
+ }),
137137
+ new webpack.optimize.CommonsChunkPlugin({
138-
+ name: 'runtime'
138+
+ name: 'manifest'
139139
+ })
140140
],
141141
output: {
@@ -145,16 +145,16 @@ __webpack.config.js__
145145
};
146146
```
147147

148-
Let's run another build to see the extracted `runtime` bundle:
148+
Let's run another build to see the extracted `manifest` bundle:
149149

150150
``` bash
151151
Hash: 80552632979856ddab34
152152
Version: webpack 3.3.0
153153
Time: 1512ms
154-
Asset Size Chunks Chunk Names
155-
main.5ec8e954e32d66dee1aa.js 542 kB 0 [emitted] [big] main
156-
runtime.719796322be98041fff2.js 5.82 kB 1 [emitted] runtime
157-
index.html 275 bytes [emitted]
154+
Asset Size Chunks Chunk Names
155+
main.5ec8e954e32d66dee1aa.js 542 kB 0 [emitted] [big] main
156+
manifest.719796322be98041fff2.js 5.82 kB 1 [emitted] manifest
157+
index.html 275 bytes [emitted]
158158
[0] ./src/index.js 336 bytes {0} [built]
159159
[2] (webpack)/buildin/global.js 509 bytes {0} [built]
160160
[3] (webpack)/buildin/module.js 517 bytes {0} [built]
@@ -188,7 +188,7 @@ __webpack.config.js__
188188
+ name: 'vendor'
189189
+ }),
190190
new webpack.optimize.CommonsChunkPlugin({
191-
name: 'runtime'
191+
name: 'manifest'
192192
})
193193
],
194194
output: {
@@ -198,19 +198,19 @@ __webpack.config.js__
198198
};
199199
```
200200

201-
W> Note that order matters here. The `'vendor'` instance of the `CommonsChunkPlugin` must be included prior to the `'runtime'` instance.
201+
W> Note that order matters here. The `'vendor'` instance of the `CommonsChunkPlugin` must be included prior to the `'manifest'` instance.
202202

203203
Let's run another build to see our new `vendor` bundle:
204204

205205
``` bash
206206
Hash: 69eb92ebf8935413280d
207207
Version: webpack 3.3.0
208208
Time: 1502ms
209-
Asset Size Chunks Chunk Names
210-
vendor.8196d409d2f988123318.js 541 kB 0 [emitted] [big] vendor
211-
main.0ac0ae2d4a11214ccd19.js 791 bytes 1 [emitted] main
212-
runtime.004a1114de8bcf026622.js 5.85 kB 2 [emitted] runtime
213-
index.html 352 bytes [emitted]
209+
Asset Size Chunks Chunk Names
210+
vendor.8196d409d2f988123318.js 541 kB 0 [emitted] [big] vendor
211+
main.0ac0ae2d4a11214ccd19.js 791 bytes 1 [emitted] main
212+
manifest.004a1114de8bcf026622.js 5.85 kB 2 [emitted] manifest
213+
index.html 352 bytes [emitted]
214214
[1] ./src/index.js 336 bytes {1} [built]
215215
[2] (webpack)/buildin/global.js 509 bytes {0} [built]
216216
[3] (webpack)/buildin/module.js 517 bytes {0} [built]
@@ -269,11 +269,11 @@ Running another build, we would expect only our `main` bundle's hash to change,
269269
Hash: d38a06644fdbb898d795
270270
Version: webpack 3.3.0
271271
Time: 1445ms
272-
Asset Size Chunks Chunk Names
273-
vendor.a7561fb0e9a071baadb9.js 541 kB 0 [emitted] [big] vendor
274-
main.b746e3eb72875af2caa9.js 1.22 kB 1 [emitted] main
275-
runtime.1400d5af64fc1b7b3a45.js 5.85 kB 2 [emitted] runtime
276-
index.html 352 bytes [emitted]
272+
Asset Size Chunks Chunk Names
273+
vendor.a7561fb0e9a071baadb9.js 541 kB 0 [emitted] [big] vendor
274+
main.b746e3eb72875af2caa9.js 1.22 kB 1 [emitted] main
275+
manifest.1400d5af64fc1b7b3a45.js 5.85 kB 2 [emitted] manifest
276+
index.html 352 bytes [emitted]
277277
[1] ./src/index.js 421 bytes {1} [built]
278278
[2] (webpack)/buildin/global.js 509 bytes {0} [built]
279279
[3] (webpack)/buildin/module.js 517 bytes {0} [built]
@@ -286,7 +286,7 @@ runtime.1400d5af64fc1b7b3a45.js 5.85 kB 2 [emitted] runtime
286286

287287
- The `main` bundle changed because of its new content.
288288
- The `vendor` bundle changed because its `module.id` was changed.
289-
- And, the `runtime` bundle changed because it now contains a reference to a new module.
289+
- And, the `manifest` bundle changed because it now contains a reference to a new module.
290290

291291
The first and last are expected -- it's the `vendor` hash we want to fix. Luckily, there are two plugins we can use to resolve this issue. The first is the [`NamedModulesPlugin`](/plugins/named-modules-plugin), which will use the path to the module rather than a numerical identifier. While this plugin is useful during development for more readable output, it does take a bit longer to run. The second option is the [`HashedModuleIdsPlugin`](/plugins/hashed-module-ids-plugin), which is recommended for production builds:
292292

@@ -315,7 +315,7 @@ __webpack.config.js__
315315
name: 'vendor'
316316
}),
317317
new webpack.optimize.CommonsChunkPlugin({
318-
name: 'runtime'
318+
name: 'manifest'
319319
})
320320
],
321321
output: {
@@ -331,11 +331,11 @@ Now, despite any new local dependencies, our `vendor` hash should stay consisten
331331
Hash: 1f49b42afb9a5acfbaff
332332
Version: webpack 3.3.0
333333
Time: 1372ms
334-
Asset Size Chunks Chunk Names
335-
vendor.eed6dcc3b30cfa138aaa.js 541 kB 0 [emitted] [big] vendor
336-
main.d103ac311788fcb7e329.js 1.22 kB 1 [emitted] main
337-
runtime.d2a6dc1ccece13f5a164.js 5.85 kB 2 [emitted] runtime
338-
index.html 352 bytes [emitted]
334+
Asset Size Chunks Chunk Names
335+
vendor.eed6dcc3b30cfa138aaa.js 541 kB 0 [emitted] [big] vendor
336+
main.d103ac311788fcb7e329.js 1.22 kB 1 [emitted] main
337+
manifest.d2a6dc1ccece13f5a164.js 5.85 kB 2 [emitted] manifest
338+
index.html 352 bytes [emitted]
339339
[3Di9] ./src/print.js 62 bytes {1} [built]
340340
[3IRH] (webpack)/buildin/module.js 517 bytes {0} [built]
341341
[DuR2] (webpack)/buildin/global.js 509 bytes {0} [built]
@@ -373,11 +373,11 @@ And finally run our build again:
373373
Hash: 37e1358f135c0b992f72
374374
Version: webpack 3.3.0
375375
Time: 1557ms
376-
Asset Size Chunks Chunk Names
377-
vendor.eed6dcc3b30cfa138aaa.js 541 kB 0 [emitted] [big] vendor
378-
main.fc7f38e648da79db2aba.js 891 bytes 1 [emitted] main
379-
runtime.bb5820632fb66c3fb357.js 5.85 kB 2 [emitted] runtime
380-
index.html 352 bytes [emitted]
376+
Asset Size Chunks Chunk Names
377+
vendor.eed6dcc3b30cfa138aaa.js 541 kB 0 [emitted] [big] vendor
378+
main.fc7f38e648da79db2aba.js 891 bytes 1 [emitted] main
379+
manifest.bb5820632fb66c3fb357.js 5.85 kB 2 [emitted] manifest
380+
index.html 352 bytes [emitted]
381381
[3IRH] (webpack)/buildin/module.js 517 bytes {0} [built]
382382
[DuR2] (webpack)/buildin/global.js 509 bytes {0} [built]
383383
[0] multi lodash 28 bytes {0} [built]

0 commit comments

Comments
 (0)