Skip to content

Commit

Permalink
Merge pull request #10292 from wojtekmaj/replace-uglify-es-with-terser
Browse files Browse the repository at this point in the history
Replace uglify-es with Terser
  • Loading branch information
timvandermeij authored Nov 23, 2018
2 parents 34e7918 + 01727e0 commit 33fa33e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
10 changes: 5 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,18 +717,18 @@ gulp.task('minified-post', ['minified-pre'], function () {
console.log();
console.log('### Minifying js files');

var UglifyES = require('uglify-es');
var Terser = require('terser');
// V8 chokes on very long sequences. Works around that.
var optsForHugeFile = { compress: { sequences: false, }, };

fs.writeFileSync(MINIFIED_DIR + '/web/pdf.viewer.js',
UglifyES.minify(viewerFiles).code);
Terser.minify(viewerFiles).code);
fs.writeFileSync(MINIFIED_DIR + '/build/pdf.min.js',
UglifyES.minify(pdfFile).code);
Terser.minify(pdfFile).code);
fs.writeFileSync(MINIFIED_DIR + '/build/pdf.worker.min.js',
UglifyES.minify(pdfWorkerFile, optsForHugeFile).code);
Terser.minify(pdfWorkerFile, optsForHugeFile).code);
fs.writeFileSync(MINIFIED_DIR + 'image_decoders/pdf.image_decoders.min.js',
UglifyES.minify(pdfImageDecodersFile).code);
Terser.minify(pdfImageDecodersFile).code);

console.log();
console.log('### Cleaning js files');
Expand Down
29 changes: 29 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"streamqueue": "^1.1.2",
"systemjs": "^0.21.5",
"systemjs-plugin-babel": "^0.0.25",
"terser": "^3.10.12",
"ttest": "^1.1.0",
"typogr": "^0.6.8",
"uglify-es": "^3.3.9",
"vinyl": "^2.2.0",
"vinyl-fs": "^3.0.3",
"webpack": "4.21.0",
Expand Down

0 comments on commit 33fa33e

Please sign in to comment.