Skip to content

Commit

Permalink
[TIMOB-24736] Fix issue in minification of code
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed May 26, 2017
1 parent b1f2468 commit 689223b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/jsanalyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,23 @@ exports.analyzeJs = function analyzeJs(contents, opts) {
// minify
if (opts.minify) {
// FIXME we can't re-use the ast here, because we traversed it
var minified = babel.transform(contents, {filename: opts.filename, minified: true, compact: true, comments: false, presets: [babili]});
var minified = babel.transform(contents, {
filename: opts.filename,
minified: true,
compact: true,
comments: false,
presets: [
{
plugins: [
require("babel-plugin-minify-numeric-literals"),
require("babel-plugin-minify-constant-folding"),
require("babel-plugin-minify-dead-code-elimination")
]
}
]
});
results.contents = minified.code;
}

return results;
};

Expand Down

0 comments on commit 689223b

Please sign in to comment.