Skip to content

chore: switch from uglifyjs-webpack-plugin to terser-webpack-plugin #2742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/@vue/cli-service/lib/config/prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ module.exports = (api, options) => {
if (process.env.VUE_CLI_TEST) {
webpackConfig.optimization.minimize(false)
} else {
const UglifyPlugin = require('uglifyjs-webpack-plugin')
const uglifyOptions = require('./uglifyOptions')
const TerserPlugin = require('terser-webpack-plugin')
const terserOptions = require('./terserOptions')
webpackConfig.optimization.minimizer([
new UglifyPlugin(uglifyOptions(options))
new TerserPlugin(terserOptions(options))
])
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = options => ({
uglifyOptions: {
terserOptions: {
compress: {
// turn off flags with small gains to speed up minification
arrows: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"source-map-url": "^0.4.0",
"ssri": "^6.0.0",
"string.prototype.padend": "^3.0.0",
"terser-webpack-plugin": "^1.1.0",
"thread-loader": "^1.1.5",
"uglifyjs-webpack-plugin": "^1.2.7",
"url-loader": "^1.1.0",
"vue-loader": "^15.4.2",
"webpack": "^4.15.1",
Expand Down