This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree 4 files changed +19
-9
lines changed
4 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ function getRequiredDeps(packageJson) {
67
67
"nativescript-worker-loader" : "~0.8.1" ,
68
68
"resolve-url-loader" : "~2.2.1" ,
69
69
"extract-text-webpack-plugin" : "~3.0.2" ,
70
+ "uglifyjs-webpack-plugin" : "~1.1.6" ,
70
71
} ;
71
72
72
73
if ( isAngular ( { packageJson} ) ) {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
7
7
const ExtractTextPlugin = require ( "extract-text-webpack-plugin" ) ;
8
8
const { BundleAnalyzerPlugin } = require ( "webpack-bundle-analyzer" ) ;
9
9
const { NativeScriptWorkerPlugin } = require ( "nativescript-worker-loader/NativeScriptWorkerPlugin" ) ;
10
+ const UglifyJsPlugin = require ( "uglifyjs-webpack-plugin" ) ;
10
11
11
12
module . exports = env => {
12
13
const platform = env && ( env . android && "android" || env . ios && "ios" ) ;
@@ -151,9 +152,11 @@ module.exports = env => {
151
152
152
153
// Work around an Android issue by setting compress = false
153
154
const compress = platform !== "android" ;
154
- config . plugins . push ( new webpack . optimize . UglifyJsPlugin ( {
155
- mangle : { except : nsWebpack . uglifyMangleExcludes } ,
156
- compress,
155
+ config . plugins . push ( new UglifyJsPlugin ( {
156
+ uglifyOptions : {
157
+ mangle : { reserved : nsWebpack . uglifyMangleExcludes } ,
158
+ compress,
159
+ }
157
160
} ) ) ;
158
161
}
159
162
return config ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target
6
6
const CopyWebpackPlugin = require ( "copy-webpack-plugin" ) ;
7
7
const { BundleAnalyzerPlugin } = require ( "webpack-bundle-analyzer" ) ;
8
8
const { NativeScriptWorkerPlugin } = require ( "nativescript-worker-loader/NativeScriptWorkerPlugin" ) ;
9
+ const UglifyJsPlugin = require ( "uglifyjs-webpack-plugin" ) ;
9
10
10
11
module . exports = env => {
11
12
const platform = env && ( env . android && "android" || env . ios && "ios" ) ;
@@ -129,9 +130,11 @@ module.exports = env => {
129
130
130
131
// Work around an Android issue by setting compress = false
131
132
const compress = platform !== "android" ;
132
- config . plugins . push ( new webpack . optimize . UglifyJsPlugin ( {
133
- mangle : { except : nsWebpack . uglifyMangleExcludes } ,
134
- compress,
133
+ config . plugins . push ( new UglifyJsPlugin ( {
134
+ uglifyOptions : {
135
+ mangle : { reserved : nsWebpack . uglifyMangleExcludes } ,
136
+ compress,
137
+ }
135
138
} ) ) ;
136
139
}
137
140
return config ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target
6
6
const CopyWebpackPlugin = require ( "copy-webpack-plugin" ) ;
7
7
const { BundleAnalyzerPlugin } = require ( "webpack-bundle-analyzer" ) ;
8
8
const { NativeScriptWorkerPlugin } = require ( "nativescript-worker-loader/NativeScriptWorkerPlugin" ) ;
9
+ const UglifyJsPlugin = require ( "uglifyjs-webpack-plugin" ) ;
9
10
10
11
module . exports = env => {
11
12
const platform = env && ( env . android && "android" || env . ios && "ios" ) ;
@@ -131,9 +132,11 @@ module.exports = env => {
131
132
132
133
// Work around an Android issue by setting compress = false
133
134
const compress = platform !== "android" ;
134
- config . plugins . push ( new webpack . optimize . UglifyJsPlugin ( {
135
- mangle : { except : nsWebpack . uglifyMangleExcludes } ,
136
- compress,
135
+ config . plugins . push ( new UglifyJsPlugin ( {
136
+ uglifyOptions : {
137
+ mangle : { reserved : nsWebpack . uglifyMangleExcludes } ,
138
+ compress,
139
+ }
137
140
} ) ) ;
138
141
}
139
142
return config ;
You can’t perform that action at this time.
0 commit comments