From 7deb3e70a3550c8a42920dd1cd20d5d2a2991fef Mon Sep 17 00:00:00 2001 From: Galen Date: Fri, 10 Jan 2025 12:08:27 -0800 Subject: [PATCH] commit webpack manifest plugin to webpack dev config, re #11670 --- webpack/webpack.config.dev.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/webpack/webpack.config.dev.js b/webpack/webpack.config.dev.js index 2e3da3f6c00..a2c4635c5f5 100644 --- a/webpack/webpack.config.dev.js +++ b/webpack/webpack.config.dev.js @@ -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 = () => { @@ -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, @@ -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; + }, }) ], }));