Skip to content

Commit

Permalink
Switching to using terser instead of uglify-es (so it's maintained). …
Browse files Browse the repository at this point in the history
…see #721
  • Loading branch information
jonathanolson committed Feb 25, 2020
1 parent 567956c commit 2c453d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/grunt/generateCoverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* To generate coverage for a sim (or other codebase):
* 1. Build with instrumentation added (preferably without minification):
* $ grunt --uglify=false --instrument=true
* $ grunt --minify.uglify=false --instrument=true
* 2. Run the instrumented version from the build directory.
* 3. When done, in the JS console, `copy( __coverage__ )` to copy JSON coverage information into your clipboard.
* 4. Paste it into build/instrumentation/coverage.json
Expand Down
5 changes: 2 additions & 3 deletions js/grunt/minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// modules
const _ = require( 'lodash' ); // eslint-disable-line require-statement-match
const transpile = require( './transpile' );
const uglifyES = require( 'uglify-es' ); // eslint-disable-line require-statement-match
const terser = require( 'terser' );

const MINIFY_DEFAULTS = {
minify: true,
Expand Down Expand Up @@ -75,8 +75,7 @@ const minify = function( js, options ) {
}

if ( uglify ) {

const result = uglifyES.minify( js, uglifyOptions );
const result = terser.minify( js, uglifyOptions );

if ( result.error ) {
console.log( result.error );
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"request": "^2.87.0",
"request-promise-native": "^1.0.7",
"requirejs": "~2.3.5",
"uglify-es": "~3.1.10",
"terser": "~4.6.4",
"url-loader": "^3.0.0",
"webpack": "^4.41.4",
"webpack-cli": "^3.3.10",
Expand Down

0 comments on commit 2c453d5

Please sign in to comment.