Skip to content

Commit

Permalink
Merge pull request openedx#34498 from brian-smith-tcril/fix-prod-webp…
Browse files Browse the repository at this point in the history
…ack-config

fix: replace outdated webpack plugins
  • Loading branch information
Feanil Patel authored Apr 9, 2024
2 parents f8eecec + b204f1b commit 41953bb
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var Merge = require('webpack-merge');
var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
var _ = require('underscore');
const TerserPlugin = require("terser-webpack-plugin");

var commonConfig = require('./webpack.common.config.js');

Expand All @@ -22,16 +23,14 @@ var optimizedConfig = Merge.smart(commonConfig, {
}),
new webpack.LoaderOptionsPlugin({ // This may not be needed; legacy option for loaders written for webpack 1
minimize: true
}),
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.CommonsChunkPlugin({
// If the value below changes, update the render_bundle call in
// common/djangoapps/pipeline_mako/templates/static_content.html
name: 'commons',
filename: 'commons.[chunkhash].js',
minChunks: 3
})
]
],
optimization: {
minimize: true,
minimizer: [
new TerserPlugin(),
],
}
}
});

Expand All @@ -52,16 +51,7 @@ var requireCompatConfig = Merge.smart(optimizedConfig, {
web: {
output: {
filename: '[name].js'
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
// If the value below changes, update the render_bundle call in
// common/djangoapps/pipeline_mako/templates/static_content.html
name: 'commons',
filename: 'commons.js',
minChunks: 3
})
]
}
}
});

Expand Down

0 comments on commit 41953bb

Please sign in to comment.