Skip to content

Commit eb6fb2d

Browse files
IgorMinarkara
authored andcommitted
build: switch from uglify-js to uglify-es (angular#22669)
This enables us to minify ES2015 code. PR Close angular#22669
1 parent c602563 commit eb6fb2d

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ minify() {
219219
base_file=$( basename "${file}" )
220220
if [[ "${base_file}" =~ $regex && "${base_file##*.}" != "map" ]]; then
221221
local out_file=$(dirname "${file}")/${BASH_REMATCH[1]}.min.js
222-
$UGLIFYJS -c --screw-ie8 --comments -o ${out_file} --source-map ${out_file}.map --prefix relative --source-map-include-sources ${file}
222+
echo "====== $UGLIFY -c --comments -o ${out_file} --source-map "includeSources=true,content='${file}.map',filename='${out_file}.map'" ${file}"
223+
$UGLIFY -c --comments -o ${out_file} --source-map "includeSources=true,content='${file}.map',filename='${out_file}.map'" ${file}
223224
fi
224225
done
225226
}
@@ -344,7 +345,7 @@ N="
344345
"
345346
TSC=`pwd`/node_modules/.bin/tsc
346347
NGC="node --max-old-space-size=3000 `pwd`/dist/tools/@angular/compiler-cli/src/main"
347-
UGLIFYJS=`pwd`/node_modules/.bin/uglifyjs
348+
UGLIFY=`pwd`/node_modules/.bin/uglifyjs
348349
TSCONFIG=./tools/tsconfig.json
349350
ROLLUP=`pwd`/node_modules/.bin/rollup
350351

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"tslint-eslint-rules": "4.1.1",
106106
"tsutils": "2.20.0",
107107
"typescript": "2.7.x",
108-
"uglify-js": "2.8.29",
108+
"uglify-es": "^3.3.9",
109109
"universal-analytics": "0.4.15",
110110
"vlq": "0.2.2",
111111
"vrsource-tslint-rules": "5.1.1",

yarn.lock

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,10 @@ commander@^2.5.0, commander@^2.8.1, commander@^2.9.0:
12031203
version "2.11.0"
12041204
resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563"
12051205

1206+
commander@~2.13.0:
1207+
version "2.13.0"
1208+
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
1209+
12061210
12071211
version "0.0.1"
12081212
resolved "https://registry.yarnpkg.com/commondir/-/commondir-0.0.1.tgz#89f00fdcd51b519c578733fec563e6a6da7f5be2"
@@ -6562,6 +6566,10 @@ source-map@^0.4.4, source-map@~0.4.1:
65626566
dependencies:
65636567
amdefine ">=0.0.4"
65646568

6569+
source-map@~0.6.1:
6570+
version "0.6.1"
6571+
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
6572+
65656573
sparkles@^1.0.0:
65666574
version "1.0.0"
65676575
resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3"
@@ -7208,6 +7216,13 @@ [email protected]:
72087216
version "2.7.2"
72097217
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
72107218

7219+
uglify-es@^3.3.9:
7220+
version "3.3.9"
7221+
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"
7222+
dependencies:
7223+
commander "~2.13.0"
7224+
source-map "~0.6.1"
7225+
72117226
[email protected], uglify-js@~1.2.5:
72127227
version "1.2.6"
72137228
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-1.2.6.tgz#d354b2d3c1cf10ebc18fa78c11a28bdd9ce1580d"
@@ -7216,7 +7231,7 @@ [email protected]:
72167231
version "1.3.3"
72177232
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-1.3.3.tgz#ddd3e98aa27f5f47e589cfb3f95cddba26096190"
72187233

7219-
uglify-js@2.8.29, uglify-js@^2.6:
7234+
uglify-js@^2.6:
72207235
version "2.8.29"
72217236
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd"
72227237
dependencies:

0 commit comments

Comments
 (0)