Skip to content

Commit

Permalink
commit webpack manifest plugin to webpack dev config, re #11670
Browse files Browse the repository at this point in the history
  • Loading branch information
whatisgalen committed Jan 10, 2025
1 parent 52744ae commit 7deb3e7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions webpack/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const Webpack = require('webpack');
const { merge } = require('webpack-merge');
const StylelintPlugin = require('stylelint-webpack-plugin');

const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const commonWebpackConfigPromise = require('./webpack.common.js');

module.exports = () => {
Expand All @@ -15,6 +16,7 @@ module.exports = () => {
// devtool: 'inline-source-map',
output: {
chunkFilename: Path.join('js', '[name].chunk.js'),
filename: Path.join('js', '[name].[chunkhash:8].js'),
},
devServer: {
historyApiFallback: true,
Expand Down Expand Up @@ -43,6 +45,17 @@ module.exports = () => {
}),
new StylelintPlugin({
files: Path.join('src', '**/*.s?(a|c)ss'),
}),
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 7deb3e7

Please sign in to comment.