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 path = require('path');
var Buffer = require('buffer').Buffer;
var gzip = require('gzip');
var zlib = require('zlib');
var RequireKernel = require('require-kernel');
var server = require('../server');
var os = require('os');
@ -233,23 +233,14 @@ function _handle(req, res, jsFilename, jsFiles) {
//write the results compressed in a file
function(callback)
{
//spawn a gzip process if we're on a unix system
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
err = err === 0 ? null : err;
zlib.gzip(result, function(err, compressedResult){
//weird gzip bug that returns 0 instead of null if everything is ok
err = err === 0 ? null : err;
if(ERR(err, callback)) return;
if(ERR(err, callback)) return;
fs.writeFile(CACHE_DIR + "minified_" + jsFilename + ".gz", compressedResult, callback);
});
}
//skip this step on windows
else
{
callback();
}
fs.writeFile(CACHE_DIR + "minified_" + jsFilename + ".gz", compressedResult, callback);
});
}
],callback);
}

View File

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