Skip to content

Commit

Permalink
call webpackmanifestplugin in webpack prod config, re #11670
Browse files Browse the repository at this point in the history
  • Loading branch information
whatisgalen committed Jan 10, 2025
1 parent 4bedacf commit 43d034e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions webpack/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Path = require('path');
const TerserPlugin = require("terser-webpack-plugin");
const Webpack = require('webpack');
const { merge } = require('webpack-merge');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');

const commonWebpackConfigPromise = require('./webpack.common.js');

Expand Down Expand Up @@ -33,6 +34,17 @@ module.exports = () => {
new Webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
new WebpackManifestPlugin({
fileName: 'manifest.json',
publicPath: commonWebpackConfig.STATIC_URL,
generate: (seed, files) => {
const manifest = {};
files.forEach(file => {
manifest[file.name] = file.path;
});
return manifest;
},
}),
],
}));
});
Expand Down

0 comments on commit 43d034e

Please sign in to comment.