Skip to content

Commit

Permalink
Merge pull request #84 from RallyApps/uglify
Browse files Browse the repository at this point in the history
Replace uglify-js-harmony with uglify-es to support using fancy new language features in apps
  • Loading branch information
krmorse committed Feb 17, 2018
2 parents b6987cd + 8392800 commit c5b32bc
Show file tree
Hide file tree
Showing 6 changed files with 302 additions and 260 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ language: node_js
node_js:
- 8.9.4
notifications:
flowdock: 1be3193c10d5c1a9248601124cb2847b
flowdock: 1be3193c10d5c1a9248601124cb2847b
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
require( "coffee-script" );

module.exports = require( "./lib/index.js" );
9 changes: 2 additions & 7 deletions lib/build/get-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let fs = require('fs');
let path = require('path');
let async = require('async');
let coffeeScript = require('coffee-script');
let uglify = require('uglify-js-harmony');
let uglify = require('uglify-es');
let {JSHINT} = require('jshint');
let less = require('less');
let css = require('./css');
Expand Down Expand Up @@ -97,12 +97,7 @@ module.exports = {
},

compressJavaScript(code){
let ast = uglify.parse(code);
ast.figure_out_scope();
let compressor = uglify.Compressor({
unused: false});
ast = ast.transform(compressor);
return ast.print_to_string();
return uglify.minify(code).code;
},

readFile: (file, callback)=> {
Expand Down
Loading

0 comments on commit c5b32bc

Please sign in to comment.