Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace outdated webpack plugins #34498

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading