@@ -631,20 +631,27 @@ module.exports = function(webpackEnv) {
631631 filename : 'static/css/[name].[contenthash:8].css' ,
632632 chunkFilename : 'static/css/[name].[contenthash:8].chunk.css' ,
633633 } ) ,
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
637640 new ManifestPlugin ( {
638641 fileName : 'asset-manifest.json' ,
639642 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 ) => {
642645 manifest [ file . name ] = file . path ;
643646 return manifest ;
644647 } , seed ) ;
648+ const entrypointFiles = entrypoints . main . filter (
649+ fileName => ! fileName . endsWith ( '.map' )
650+ ) ;
645651
646652 return {
647653 files : manifestFiles ,
654+ entrypoints : entrypointFiles ,
648655 } ;
649656 } ,
650657 } ) ,
0 commit comments