Skip to content

Commit

Permalink
Merge pull request #42 from DickSmith/master
Browse files Browse the repository at this point in the history
UglifyES options were never used when defined
  • Loading branch information
gdborton committed Dec 8, 2017
2 parents 00064c7 + cc69fce commit 4e3d31a
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 4e3d31a

Please sign in to comment.