Skip to content

Commit 13368e5

Browse files
committed
fix: Use standalone uglify plugin
1 parent c046d6d commit 13368e5

File tree

3 files changed

+5
-41
lines changed

3 files changed

+5
-41
lines changed

package-lock.json

-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"build-eslint": "rimraf eslint && npm run clone-eslint && npm run webpackify-eslint && cd eslint && npm install --production",
1111
"clone-eslint": "git clone https://github.com/eslint/eslint.git eslint",
1212
"webpackify-eslint": "node tools/webpackify-eslint",
13-
"develop": "NODE_ENV=development PORT=8014 concurrently --kill-others 'nodemon ./packages/backend --watch packages/backend' 'webpack-dev-server --no-info --config webpack'",
14-
"build": "NODE_ENV=production webpack --config webpack --display-error-details",
13+
"develop": "NODE_ENV=development PORT=8014 concurrently --kill-others 'nodemon ./packages/backend --watch packages/backend' 'webpack-dev-server --no-info --config webpack --mode=development'",
14+
"build": "NODE_ENV=production webpack --config webpack --display-error-details --mode=production",
1515
"upgrade": "rimraf package-lock.json && ncu -a -x eslint-plugin-jsx-a11y,semantic-release && npm install && lerna exec --concurrency 1 -- rimraf package-lock.json && lerna exec --concurrency 1 -- ncu -a && lerna exec -- npm install",
1616
"semantic-release": "semantic-release pre && ssh-keyscan 192.241.157.86 >> ~/.ssh/known_hosts && npm run deploy && semantic-release post",
1717
"deploy": "pm2 deploy ecosystem.config.js production --force",
@@ -90,6 +90,7 @@
9090
"semantic-release": "^6.3.6",
9191
"semver": "^5.5.0",
9292
"style-loader": "^0.21.0",
93+
"uglifyjs-webpack-plugin": "^1.2.5",
9394
"validate-commit-msg": "^2.14.0",
9495
"webpack": "^4.9.1",
9596
"webpack-cli": "^2.1.4",

webpack/plugins.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
33
const OpenBrowserPlugin = require('open-browser-webpack-plugin');
44
const HtmlWebpackPlugin = require('html-webpack-plugin');
55
const ExtractTextPlugin = require('extract-text-webpack-plugin');
6+
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
67

78
const { isDevelopment, isProduction, devPort } = require('./env');
89

@@ -32,11 +33,7 @@ if (isDevelopment) {
3233
})
3334
);
3435
} else if (isProduction) {
35-
plugins.push(new webpack.optimize.UglifyJsPlugin({
36-
compress: {
37-
warnings: false
38-
}
39-
}));
36+
plugins.push(new UglifyJsPlugin());
4037
}
4138

4239
plugins.push(new CopyWebpackPlugin([{

0 commit comments

Comments
 (0)