File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## 0.21.0 Webpack 4 Upgrade
4
4
5
- * Webpack was upgraded to version 4. This includes a number of major
5
+ * [ BC BREAK ] Webpack was upgraded to version 4. This includes a number of major
6
6
and minor changes. The changes are listed below.
7
7
8
+ * [ BC BREAK] If you're using ` createSharedEntry() ` , the name of the
9
+ ` manifest.js ` file is now ` runtime.js ` . You will need to update
10
+ your ` <script> ` tag to point to the new ` runtime.js ` .
11
+
8
12
* The NamedModulesPlugin was removed.
9
13
10
14
* The ` babel-preset-env ` package (which was at version ^1.2.2) was
Original file line number Diff line number Diff line change @@ -321,6 +321,27 @@ class ConfigGenerator {
321
321
optimization . namedModules = true ;
322
322
}
323
323
324
+ if ( this . webpackConfig . sharedCommonsEntryName ) {
325
+ const cacheGroups = { } ;
326
+ cacheGroups [ this . webpackConfig . sharedCommonsEntryName ] = {
327
+ chunks : 'initial' ,
328
+ name : this . webpackConfig . sharedCommonsEntryName ,
329
+ // important: setting this to the entry name means that
330
+ // all modules included by that entry go into this cache group
331
+ test : this . webpackConfig . sharedCommonsEntryName ,
332
+ // seems to default the rest of the options (like minSize)
333
+ // to settings so that modules matched by "test" are
334
+ // *definitely* included.
335
+ enforce : true ,
336
+ } ;
337
+
338
+ optimization . splitChunks = {
339
+ cacheGroups : cacheGroups
340
+ } ;
341
+ // causes a runtime.js to be emitted with the Webpack runtime
342
+ optimization . runtimeChunk = 'single' ;
343
+ }
344
+
324
345
return optimization ;
325
346
}
326
347
You can’t perform that action at this time.
0 commit comments