Skip to content

Commit

Permalink
UglifyES options were never used when defined
Browse files Browse the repository at this point in the history
  • Loading branch information
DickSmith authored and gdborton committed Dec 6, 2017
1 parent 00064c7 commit cc69fce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ function processMessage(msgLocation, callback) {
const cacheKey = cache.createCacheKey(source + !!map, message.options);
// We do not check the cache here because we already determined that this asset yields a cache
// miss in the parent process.
const uglifier = message.options.uglifyES ? require('uglify-es') : require('uglify-js'); // eslint-disable-line global-require, max-len
const minifiedContent = minify(source, map, message.options.uglifyJS, uglifier);
const uglifyES = message.options.uglifyES;
const uglifyJS = message.options.uglifyJS;
const uglifier = uglifyES ? require('uglify-es') : require('uglify-js'); // eslint-disable-line global-require, max-len
const minifiedContent = minify(source, map, uglifyES || uglifyJS, uglifier);
cache.saveToCache(cacheKey, JSON.stringify({
source: minifiedContent.code,
map: minifiedContent.map,
Expand Down

0 comments on commit cc69fce

Please sign in to comment.