Skip to content

Commit

Permalink
Remove logs in prod builds
Browse files Browse the repository at this point in the history
  • Loading branch information
RED committed Aug 30, 2024
1 parent 80d68cd commit d79fff4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"eslint-config-prettier": "^8.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.4",
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4",
Expand Down
10 changes: 10 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path');
const { UserscriptPlugin } = require('webpack-userscript');
const TerserPlugin = require('terser-webpack-plugin');


const dev = process.env.NODE_ENV === 'development';
Expand All @@ -22,6 +23,15 @@ module.exports = {
},
optimization: {
minimize: dev ? false : true,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
drop_console: dev ? false : true,
},
},
}),
],
},
plugins: [
new UserscriptPlugin({
Expand Down

0 comments on commit d79fff4

Please sign in to comment.