Skip to content

Commit

Permalink
Swap JS minifier from uglify to terser
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Nov 29, 2022
1 parent 6488b3c commit 2e750ce
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 71 deletions.
122 changes: 56 additions & 66 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 @@ -55,7 +55,7 @@
"gulp-rename": "^2.0.0",
"gulp-sass": "^5.1.0",
"gulp-task-listing": "^1.1.1",
"gulp-uglify": "^3.0.2",
"gulp-terser": "^2.1.0",
"js-yaml": "^4.1.0",
"jsdoc": "^4.0.0",
"jsdoc-tsimport-plugin": "^1.0.5",
Expand Down
11 changes: 7 additions & 4 deletions tasks/gulp/compile-assets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import plumber from 'gulp-plumber'
import postcss from 'gulp-postcss'
import rename from 'gulp-rename'
import gulpSass from 'gulp-sass'
import uglify from 'gulp-uglify'
import terser from 'gulp-terser'
import merge from 'merge-stream'
import minimatch from 'minimatch'
import nodeSass from 'node-sass'
Expand Down Expand Up @@ -180,9 +180,12 @@ function compileJavaScript (stream, moduleName) {
}))

// Minify
.pipe(gulpif(isMinified, uglify({
ie8: true
})))
.pipe(gulpif(isMinified, terser({
ecma: 5,
format: { comments: false },
ie8: true,
safari10: true
}))

// Rename
.pipe(rename((path, file) => {
Expand Down

0 comments on commit 2e750ce

Please sign in to comment.