Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 7a125ee

Browse files
committed
feat: tweak the uglify configuration to enable compression for android
1 parent 612cffd commit 7a125ee

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

templates/webpack.angular.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,19 @@ module.exports = env => {
117117
},
118118
minimize: !!uglify,
119119
minimizer: [
120-
// Override default minimizer to work around an Android issue by setting compress = false
121120
new UglifyJsPlugin({
122121
uglifyOptions: {
123-
compress: platform !== "android"
122+
parallel: true,
123+
cache: true,
124+
output: {
125+
comments: false,
126+
},
127+
compress: {
128+
// The Android SBG has problems parsing the output
129+
// when these options are enabled
130+
'collapse_vars': platform !== "android",
131+
sequences: platform !== "android",
132+
}
124133
}
125134
})
126135
],

templates/webpack.javascript.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,19 @@ module.exports = env => {
114114
},
115115
minimize: !!uglify,
116116
minimizer: [
117-
// Override default minimizer to work around an Android issue by setting compress = false
118117
new UglifyJsPlugin({
119118
uglifyOptions: {
120-
compress: platform !== "android"
119+
parallel: true,
120+
cache: true,
121+
output: {
122+
comments: false,
123+
},
124+
compress: {
125+
// The Android SBG has problems parsing the output
126+
// when these options are enabled
127+
'collapse_vars': platform !== "android",
128+
sequences: platform !== "android",
129+
}
121130
}
122131
})
123132
],

templates/webpack.typescript.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,19 @@ module.exports = env => {
114114
},
115115
minimize: !!uglify,
116116
minimizer: [
117-
// Override default minimizer to work around an Android issue by setting compress = false
118117
new UglifyJsPlugin({
119118
uglifyOptions: {
120-
compress: platform !== "android"
119+
parallel: true,
120+
cache: true,
121+
output: {
122+
comments: false,
123+
},
124+
compress: {
125+
// The Android SBG has problems parsing the output
126+
// when these options are enabled
127+
'collapse_vars': platform !== "android",
128+
sequences: platform !== "android",
129+
}
121130
}
122131
})
123132
],

0 commit comments

Comments
 (0)