Skip to content

Commit a5b0ba4

Browse files
committed
Fix npm run build:ios error related to that uglify-js does not support ES6 by changing minification to Terser
1 parent 9ac7efc commit a5b0ba4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

generator/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ module.exports = async (api, options, rootOptions) => {
119119
dependencies: {},
120120
devDependencies: {
121121
'fork-ts-checker-webpack-plugin': '^0.4.15',
122-
'uglifyjs-webpack-plugin': '^2.0.1'
122+
'terser-webpack-plugin': '^1.2.3'
123123
//'tns-platform-declarations': '^4.2.1'
124124
}
125125
});

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const DefinePlugin = require('webpack/lib/DefinePlugin');
1111
// // // const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
1212

1313
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer');
14-
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
14+
const TerserPlugin = require('terser-webpack-plugin');
1515

1616
const nativescriptTarget = require('nativescript-dev-webpack/nativescript-target');
1717
const NsVueTemplateCompiler = require('nativescript-vue-template-compiler');
@@ -280,10 +280,10 @@ const nativeConfig = (api, projectOptions, env, jsOrTs, projectRoot, platform) =
280280
config.optimization.minimize(Boolean(production));
281281
config.optimization
282282
.minimizer([
283-
new UglifyJsPlugin({
283+
new TerserPlugin({
284284
parallel: true,
285285
cache: true,
286-
uglifyOptions: {
286+
terserOptions: {
287287
output: {
288288
comments: false
289289
},

0 commit comments

Comments
 (0)