Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

no more uglify, yui instead

  • Loading branch information...
commit 44d7bc40d54f7ddfa119dfb6bfb72733b885e0da 1 parent dc610bb
@jairajs89 authored
Showing with 14 additions and 12 deletions.
  1. +3 −3 package.json
  2. +11 −9 zerver.js
View
6 package.json
@@ -12,9 +12,9 @@
"node": "0.8.x"
},
"dependencies": {
- "mime" : "1.2.7" ,
- "uglify-js" : "1.3.4" ,
- "less" : "1.3.3"
+ "mime" : "1.2.7" ,
+ "yuicompressor" : "2.4.7" ,
+ "less" : "1.3.3"
},
"devDependencies": {
"stalker" : "0.0.20" ,
View
20 zerver.js
@@ -5,7 +5,7 @@ var less = require('less'),
http = require('http'),
mime = require('mime'),
path = require('path'),
- uglify = require('uglify-js'),
+ yui = require('yuicompressor'),
url = require('url' ),
zlib = require('zlib');
@@ -604,14 +604,16 @@ function compileOutput (type, data, callback) {
case 'application/javascript':
case 'text/javascript':
data = data.replace(DEBUG_LINES, '');
- try {
- var ast = uglify.parser.parse(data);
- ast = uglify.uglify.ast_mangle(ast);
- ast = uglify.uglify.ast_squeeze(ast);
- data = uglify.uglify.gen_code(ast);
- }
- catch (err) {}
- callback(type, data);
+ yui.compress(data, {
+ 'charset' : 'utf8' ,
+ 'type' : 'js' ,
+ 'nomunge' : true
+ }, function (err, compiledJS) {
+ if ( !err ) {
+ data = compiledJS;
+ }
+ callback(type, data);
+ });
break;
case 'text/css':
Please sign in to comment.
Something went wrong with that request. Please try again.