@@ -631,20 +631,27 @@ module.exports = function(webpackEnv) {
631
631
filename : 'static/css/[name].[contenthash:8].css' ,
632
632
chunkFilename : 'static/css/[name].[contenthash:8].chunk.css' ,
633
633
} ) ,
634
- // Generate a manifest file which contains a mapping of all asset filenames
635
- // to their corresponding output file so that tools can pick it up without
636
- // having to parse `index.html`.
634
+ // Generate an asset manifest file with the following content:
635
+ // - "files" key: Mapping of all asset filenames to their corresponding
636
+ // output file so that tools can pick it up without having to parse
637
+ // `index.html`
638
+ // - "entrypoints" key: Array of files which are included in `index.html`,
639
+ // can be used to reconstruct the HTML if necessary
637
640
new ManifestPlugin ( {
638
641
fileName : 'asset-manifest.json' ,
639
642
publicPath : publicPath ,
640
- generate : ( seed , files ) => {
641
- const manifestFiles = files . reduce ( function ( manifest , file ) {
643
+ generate : ( seed , files , entrypoints ) => {
644
+ const manifestFiles = files . reduce ( ( manifest , file ) => {
642
645
manifest [ file . name ] = file . path ;
643
646
return manifest ;
644
647
} , seed ) ;
648
+ const entrypointFiles = entrypoints . main . filter (
649
+ fileName => ! fileName . endsWith ( '.map' )
650
+ ) ;
645
651
646
652
return {
647
653
files : manifestFiles ,
654
+ entrypoints : entrypointFiles ,
648
655
} ;
649
656
} ,
650
657
} ) ,
0 commit comments