From 717effa958c81047ab853819ae1565376175fa94 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Thu, 8 Sep 2022 13:05:59 -0700 Subject: [PATCH] Implement webpack performance suggestions from docs. Only use full hashes for production builds. Turn off pathinfo for development. --- webpack.config.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 6179e50b13..be0d1cc069 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -51,10 +51,11 @@ module.exports = (env = {}) => { htmlScreenshot: ['./shared/utils/htmlScreenshot.js'], }, output: { - filename: '[name]-[fullhash].js', - chunkFilename: '[name]-[id]-[fullhash].js', + filename: dev ? '[name].js' : '[name]-[fullhash].js', + chunkFilename: dev ? '[name]-[id].js' : '[name]-[id]-[fullhash].js', path: bundleOutputDir, publicPath: dev ? 'http://127.0.0.1:4000/dist/' : '/static/studio/', + pathinfo: !dev, }, devServer: { port: 4000, @@ -97,8 +98,8 @@ module.exports = (env = {}) => { filename: path.resolve(djangoProjectDir, 'build', 'webpack-stats.json'), }), new MiniCssExtractPlugin({ - filename: '[name]-[fullhash].css', - chunkFilename: '[name]-[fullhash]-[id].css', + filename: dev ? '[name].css' :'[name]-[fullhash].css', + chunkFilename: dev ? '[name]-[id].css' :'[name]-[fullhash]-[id].css', }), new WebpackRTLPlugin({ minify: false,