Skip to content

Commit 76ef9fa

Browse files
author
Jack Zhao
authored
Merge pull request #4014 from viankakrisna/enable-manifest-plugin-on-dev
enable manifest plugin on dev
2 parents c1b0175 + f17914c commit 76ef9fa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/react-scripts/config/webpack.config.dev.js

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
2020
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent');
2121
const getClientEnvironment = require('./env');
2222
const paths = require('./paths');
23+
const ManifestPlugin = require('webpack-manifest-plugin');
2324

2425
// Webpack uses `publicPath` to determine where the app is being served from.
2526
// In development, we always serve from the root. This makes config easier.
@@ -376,6 +377,13 @@ module.exports = {
376377
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
377378
// You can remove this if you don't use Moment.js:
378379
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
380+
// Generate a manifest file which contains a mapping of all asset filenames
381+
// to their corresponding output file so that tools can pick it up without
382+
// having to parse `index.html`.
383+
new ManifestPlugin({
384+
fileName: 'asset-manifest.json',
385+
publicPath: publicPath,
386+
}),
379387
],
380388

381389
// Some libraries import Node modules but don't use them in the browser.

0 commit comments

Comments
 (0)