Skip to content

Commit

Permalink
fix (webpack): webpack deps issue - #772
Browse files Browse the repository at this point in the history
* fix (webpack): another webpack issue

* fix (webpack): uglify plugin is broken
  • Loading branch information
mickael-kerjean authored Nov 20, 2024
1 parent 69529b2 commit c7d48c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"style-loader": "^0.20.2",
"uglifyjs-webpack-plugin": "^1.2.5",
"url-loader": "^0.6.2",
"vm-browserify": "^1.1.2",
"webpack": "^5.87.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^5.1.4",
Expand Down
9 changes: 5 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,18 @@ const config = {
"crypto": require.resolve("crypto-browserify"),
"buffer": require.resolve("buffer/"),
"stream": require.resolve("stream-browserify"),
"vm": require.resolve("vm-browserify"),
},
},
mode: process.env.NODE_ENV || "production",
};


if (process.env.NODE_ENV === "production") {
config.plugins.push(new UglifyJSPlugin({
sourceMap: false,
extractComments: true,
}));
// config.plugins.push(new UglifyJSPlugin({
// sourceMap: false,
// extractComments: true,
// }));
config.plugins.push(new CompressionPlugin({
asset: "[path].gz[query]",
algorithm: "gzip",
Expand Down

0 comments on commit c7d48c9

Please sign in to comment.