Skip to content

Commit

Permalink
build: update terser to version 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-agius4 authored and clydin committed Aug 3, 2020
1 parent cee5c31 commit de253fd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"symbol-observable": "1.2.0",
"tar": "^6.0.0",
"temp": "^0.9.0",
"terser": "4.6.11",
"terser": "5.0.0",
"terser-webpack-plugin": "3.0.8",
"through2": "^4.0.0",
"tree-kill": "1.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"style-loader": "1.2.1",
"stylus": "0.54.8",
"stylus-loader": "3.0.2",
"terser": "4.8.0",
"terser": "5.0.0",
"terser-webpack-plugin": "3.0.8",
"tree-kill": "1.2.2",
"webpack": "4.44.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ async function processBundle(
filename,
map: rawMap,
compress: !isOriginal, // We only compress bundles which are downlevelled.
ecma: isOriginal ? 6 : 5,
ecma: isOriginal ? 2015 : 5,
});
} else {
result = {
Expand Down Expand Up @@ -378,18 +378,18 @@ async function processBundle(

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

// Mangle downlevel code
const minifyOutput = minify(options.filename ? { [options.filename]: code } : code, {
const minifyOutput = await minify(options.filename ? { [options.filename]: code } : code, {
compress: allowMinify && !!options.compress,
ecma: options.ecma || 5,
mangle: allowMangle,
safari10: true,
output: {
format: {
ascii_only: true,
webkit: true,
beautify: shouldBeautify,
Expand All @@ -403,10 +403,6 @@ async function terserMangle(
} as any),
});

if (minifyOutput.error) {
throw minifyOutput.error;
}

// tslint:disable-next-line: no-non-null-assertion
const outputCode = minifyOutput.code!;

Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12500,28 +12500,28 @@ terser-webpack-plugin@^1.4.3:
webpack-sources "^1.4.0"
worker-farm "^1.7.0"

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

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

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

0 comments on commit de253fd

Please sign in to comment.