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

move terser to only production config #1481

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions extension/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const HtmlWebPackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const path = require("path");
const webpack = require("webpack");

Expand All @@ -16,10 +15,6 @@ const commonConfig = (
env = { EXPERIMENTAL: false, AMPLITUDE_KEY: "", SENTRY_KEY: "" },
) => ({
cache: true,
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
entry: {
background: path.resolve(__dirname, "./public/background.ts"),
index: ["babel-polyfill", path.resolve(__dirname, "./src/popup/index.tsx")],
Expand Down
5 changes: 5 additions & 0 deletions extension/webpack.extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { commonConfig } = require("./webpack.common.js");
const Dotenv = require("dotenv-webpack");
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
const SpeedMeasurePlugin = require("speed-measure-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");

const smp = new SpeedMeasurePlugin();

Expand All @@ -19,6 +20,10 @@ const prodConfig = (
},
) =>
smp.wrap({
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
mode: "production",
optimization: {
minimize: env.PRODUCTION,
Expand Down