Skip to content

Commit

Permalink
Proper production mode for Webpack v5
Browse files Browse the repository at this point in the history
  • Loading branch information
martincik committed Oct 21, 2022
1 parent f596c39 commit c78296f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ const { DuplicatesPlugin } = require("inspectpack/plugin");

const bundleOutputDir = "./dist";

module.exports = (env) => {
const isDevBuild = !(env && env.prod);
module.exports = (env, argv) => {
const isDevBuild = argv.mode !== "production";
console.log("Production build: " + !isDevBuild);
return [
{
entry: "./src/index.ts",
Expand Down Expand Up @@ -39,7 +40,7 @@ module.exports = (env) => {
verbose: true,
}),
]
: [],
: [new StatoscopeWebpackPlugin()],
optimization: {
minimize: !isDevBuild,
},
Expand Down

0 comments on commit c78296f

Please sign in to comment.