Skip to content

Commit de253fd

Browse files
alan-agius4clydin
authored andcommitted
build: update terser to version 5.0.0
1 parent cee5c31 commit de253fd

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
"symbol-observable": "1.2.0",
213213
"tar": "^6.0.0",
214214
"temp": "^0.9.0",
215-
"terser": "4.6.11",
215+
"terser": "5.0.0",
216216
"terser-webpack-plugin": "3.0.8",
217217
"through2": "^4.0.0",
218218
"tree-kill": "1.2.2",

packages/angular_devkit/build_angular/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"style-loader": "1.2.1",
6363
"stylus": "0.54.8",
6464
"stylus-loader": "3.0.2",
65-
"terser": "4.8.0",
65+
"terser": "5.0.0",
6666
"terser-webpack-plugin": "3.0.8",
6767
"tree-kill": "1.2.2",
6868
"webpack": "4.44.1",

packages/angular_devkit/build_angular/src/utils/process-bundle.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ async function processBundle(
335335
filename,
336336
map: rawMap,
337337
compress: !isOriginal, // We only compress bundles which are downlevelled.
338-
ecma: isOriginal ? 6 : 5,
338+
ecma: isOriginal ? 2015 : 5,
339339
});
340340
} else {
341341
result = {
@@ -378,18 +378,18 @@ async function processBundle(
378378

379379
async function terserMangle(
380380
code: string,
381-
options: { filename?: string; map?: RawSourceMap; compress?: boolean; ecma?: 5 | 6 } = {},
381+
options: { filename?: string; map?: RawSourceMap; compress?: boolean; ecma?: 5 | 2015 } = {},
382382
) {
383383
// Note: Investigate converting the AST instead of re-parsing
384384
// estree -> terser is already supported; need babel -> estree/terser
385385

386386
// Mangle downlevel code
387-
const minifyOutput = minify(options.filename ? { [options.filename]: code } : code, {
387+
const minifyOutput = await minify(options.filename ? { [options.filename]: code } : code, {
388388
compress: allowMinify && !!options.compress,
389389
ecma: options.ecma || 5,
390390
mangle: allowMangle,
391391
safari10: true,
392-
output: {
392+
format: {
393393
ascii_only: true,
394394
webkit: true,
395395
beautify: shouldBeautify,
@@ -403,10 +403,6 @@ async function terserMangle(
403403
} as any),
404404
});
405405

406-
if (minifyOutput.error) {
407-
throw minifyOutput.error;
408-
}
409-
410406
// tslint:disable-next-line: no-non-null-assertion
411407
const outputCode = minifyOutput.code!;
412408

yarn.lock

+12-12
Original file line numberDiff line numberDiff line change
@@ -12500,28 +12500,28 @@ terser-webpack-plugin@^1.4.3:
1250012500
webpack-sources "^1.4.0"
1250112501
worker-farm "^1.7.0"
1250212502

12503-
terser@4.6.11:
12504-
version "4.6.11"
12505-
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.11.tgz#12ff99fdd62a26de2a82f508515407eb6ccd8a9f"
12506-
integrity sha512-76Ynm7OXUG5xhOpblhytE7X58oeNSmC8xnNhjWVo8CksHit0U0kO4hfNbPrrYwowLWFgM2n9L176VNx2QaHmtA==
12503+
terser@5.0.0:
12504+
version "5.0.0"
12505+
resolved "https://registry.yarnpkg.com/terser/-/terser-5.0.0.tgz#269640e4e92f15d628de1e5f01c4c61e1ba3d765"
12506+
integrity sha512-olH2DwGINoSuEpSGd+BsPuAQaA3OrHnHnFL/rDB2TVNc3srUbz/rq/j2BlF4zDXI+JqAvGr86bIm1R2cJgZ3FA==
1250712507
dependencies:
1250812508
commander "^2.20.0"
1250912509
source-map "~0.6.1"
1251012510
source-map-support "~0.5.12"
1251112511

12512-
terser@4.8.0, terser@^4.8.0:
12513-
version "4.8.0"
12514-
resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17"
12515-
integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==
12512+
terser@^4.1.2, terser@^4.3.8:
12513+
version "4.6.13"
12514+
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.13.tgz#e879a7364a5e0db52ba4891ecde007422c56a916"
12515+
integrity sha512-wMvqukYgVpQlymbnNbabVZbtM6PN63AzqexpwJL8tbh/mRT9LE5o+ruVduAGL7D6Fpjl+Q+06U5I9Ul82odAhw==
1251612516
dependencies:
1251712517
commander "^2.20.0"
1251812518
source-map "~0.6.1"
1251912519
source-map-support "~0.5.12"
1252012520

12521-
terser@^4.1.2, terser@^4.3.8:
12522-
version "4.6.13"
12523-
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.13.tgz#e879a7364a5e0db52ba4891ecde007422c56a916"
12524-
integrity sha512-wMvqukYgVpQlymbnNbabVZbtM6PN63AzqexpwJL8tbh/mRT9LE5o+ruVduAGL7D6Fpjl+Q+06U5I9Ul82odAhw==
12521+
terser@^4.8.0:
12522+
version "4.8.0"
12523+
resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17"
12524+
integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==
1252512525
dependencies:
1252612526
commander "^2.20.0"
1252712527
source-map "~0.6.1"

0 commit comments

Comments
 (0)