Skip to content
This repository was archived by the owner on Dec 5, 2022. It is now read-only.

Commit 8aaf85f

Browse files
n0v1rigor789
authored andcommitted
fix: replace abandoned uglifyjs with terser for better es6 support (#100)
activate workarounds for safari bugs when building for ios see https://github.com/terser-js/terser#minify-options
1 parent 1e9929a commit 8aaf85f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"nativescript-worker-loader": "~0.9.0",
4141
"node-sass": "^4.9.2",
4242
"sass-loader": "^7.1.0",
43-
"uglifyjs-webpack-plugin": "~1.2.7",
43+
"terser-webpack-plugin": "^1.1.0",
4444
"vue-loader": "^15.2.6",
4545
"webpack": "^4.16.4",
4646
"webpack-bundle-analyzer": "~2.13.1",

template/webpack.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const webpack = require("webpack");
44
const CleanWebpackPlugin = require("clean-webpack-plugin");
55
const CopyWebpackPlugin = require("copy-webpack-plugin");
66
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
7-
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
7+
const TerserPlugin = require('terser-webpack-plugin');
88

99
const VueLoaderPlugin = require('vue-loader/lib/plugin');
1010
const NsVueTemplateCompiler = require("nativescript-vue-template-compiler");
@@ -130,10 +130,10 @@ module.exports = env => {
130130
},
131131
minimize: Boolean(production),
132132
minimizer: [
133-
new UglifyJsPlugin({
133+
new TerserPlugin({
134134
parallel: true,
135135
cache: true,
136-
uglifyOptions: {
136+
terserOptions: {
137137
output: {
138138
comments: false,
139139
},
@@ -143,6 +143,7 @@ module.exports = env => {
143143
'collapse_vars': platform !== "android",
144144
sequences: platform !== "android",
145145
},
146+
safari10: platform === "ios",
146147
},
147148
}),
148149
],

0 commit comments

Comments
 (0)