pull/359/head
booo 2012-01-25 22:00:08 +01:00
parent 917732422d
commit 87b11045e1
2 changed files with 8 additions and 18 deletions

View File

@ -28,7 +28,7 @@ var jsp = require("uglify-js").parser;
var pro = require("uglify-js").uglify; var pro = require("uglify-js").uglify;
var path = require('path'); var path = require('path');
var Buffer = require('buffer').Buffer; var Buffer = require('buffer').Buffer;
var gzip = require('gzip'); var zlib = require('zlib');
var RequireKernel = require('require-kernel'); var RequireKernel = require('require-kernel');
var server = require('../server'); var server = require('../server');
var os = require('os'); var os = require('os');
@ -233,10 +233,7 @@ function _handle(req, res, jsFilename, jsFiles) {
//write the results compressed in a file //write the results compressed in a file
function(callback) function(callback)
{ {
//spawn a gzip process if we're on a unix system zlib.gzip(result, function(err, compressedResult){
if(os.type().indexOf("Windows") == -1)
{
gzip(result, 9, function(err, compressedResult){
//weird gzip bug that returns 0 instead of null if everything is ok //weird gzip bug that returns 0 instead of null if everything is ok
err = err === 0 ? null : err; err = err === 0 ? null : err;
@ -245,12 +242,6 @@ function _handle(req, res, jsFilename, jsFiles) {
fs.writeFile(CACHE_DIR + "minified_" + jsFilename + ".gz", compressedResult, callback); fs.writeFile(CACHE_DIR + "minified_" + jsFilename + ".gz", compressedResult, callback);
}); });
} }
//skip this step on windows
else
{
callback();
}
}
],callback); ],callback);
} }
], function(err) ], function(err)

View File

@ -18,7 +18,6 @@
"express" : "2.5.0", "express" : "2.5.0",
"clean-css" : "0.2.4", "clean-css" : "0.2.4",
"uglify-js" : "1.1.1", "uglify-js" : "1.1.1",
"gzip" : "0.1.0",
"formidable" : "1.0.7", "formidable" : "1.0.7",
"log4js" : "0.3.9", "log4js" : "0.3.9",
"jsdom-nocontextifiy" : "0.2.10", "jsdom-nocontextifiy" : "0.2.10",