# HG changeset patch # User Frank Bessou <frank.bessou@logilab.fr> # Date 1661528623 -7200 # Fri Aug 26 17:43:43 2022 +0200 # Node ID 252781958b9ff5f98e83e3c94b46f1a552a32c55 # Parent a8d65b8bde2fe6723fda3662d6f3243d66b0e79c feat(webpack): remove explicit dependency on terser Webpack already optimize build output in production mode and it seems that its options are sufficiently good. diff --git a/{{ cookiecutter.project_slug }}/package.json b/{{ cookiecutter.project_slug }}/package.json --- a/{{ cookiecutter.project_slug }}/package.json +++ b/{{ cookiecutter.project_slug }}/package.json @@ -32,7 +32,6 @@ "mini-css-extract-plugin": "^2.6.1", "react-dev-utils": "^12.0.1", "style-loader": "^3.3.1", - "terser-webpack-plugin": "^5.3.5", "ts-loader": "^9.3.1", "typescript": "^4.7.4", "webpack": "^5.74.0", diff --git a/{{ cookiecutter.project_slug }}/webpack/webpack.config.js b/{{ cookiecutter.project_slug }}/webpack/webpack.config.js --- a/{{ cookiecutter.project_slug }}/webpack/webpack.config.js +++ b/{{ cookiecutter.project_slug }}/webpack/webpack.config.js @@ -15,7 +15,6 @@ //------------------------------------------------------------------------------ -const TerserPlugin = require("terser-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const { WebpackManifestPlugin } = require("webpack-manifest-plugin"); @@ -51,8 +50,6 @@ module.exports = function (_, webpackEnv) { const isDevelopment = webpackEnv.mode === "development"; const isProduction = webpackEnv.mode === "production"; - const isProfile = process.argv.includes("--profile"); - const isProductionProfile = isProduction && isProfile; const port = process.env.PORT || 8080; const getStyleLoaders = () => [ @@ -162,35 +159,6 @@ url: false, }, }, - optimization: { - minimize: isProduction, - minimizer: [ - new TerserPlugin({ - terserOptions: { - parse: { - ecma: 8, - }, - compress: { - ecma: 5, - warnings: false, - comparisons: false, - inline: 2, - }, - mangle: { - safari10: true, - }, - keep_classnames: isProductionProfile, - keep_fnames: isProductionProfile, - output: { - ecma: 5, - comments: false, - ascii_only: true, - }, - sourceMap: false, - }, - }), - ], - }, plugins: [ new ESLintPlugin({ formatter: eslintFormatter }), new HtmlWebpackPlugin({