Skip to content

Commit

Permalink
ci: add uglifyjs-webpack-plugin & remove console
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed May 17, 2024
1 parent 75df695 commit 80d249b
Show file tree
Hide file tree
Showing 3 changed files with 347 additions and 8 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"typescript": "^5.0.4",
"webpack": "^5.61.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.4.0"
"webpack-dev-server": "^4.4.0",
"uglifyjs-webpack-plugin": "^2.2.0"
},
"peerDependencies": {
"react": ">= 16.8",
Expand Down
9 changes: 9 additions & 0 deletions webpack.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/* eslint-disable */
const path = require('path');
const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');

// const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
Expand Down Expand Up @@ -43,6 +45,13 @@ module.exports = {
new webpack.DefinePlugin({
_ASSETSPATH: JSON.stringify('https://s9.music.126.net/musicst/npm/react-monaco-editor-lite/1.2.3/'),
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
drop_console: true
}
},
})
],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
Expand Down
Loading

0 comments on commit 80d249b

Please sign in to comment.