Skip to content

Commit

Permalink
Merge pull request #3623 from rtibbles/webpack_optimization
Browse files Browse the repository at this point in the history
Implement webpack performance suggestions from docs.
  • Loading branch information
bjester authored Sep 19, 2022
2 parents eae5b0c + 717effa commit 6f343d3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6f343d3

Please sign in to comment.