Created
January 16, 2012 00:20
-
-
Save cweider/1618182 to your computer and use it in GitHub Desktop.
Simplified Patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit e42f039941e83fa54b615a472f244d3f971c8330 | |
Author: booo <[email protected]> | |
Date: Wed Dec 21 18:18:22 2011 +0100 | |
fix issue #281; remove white spaces | |
diff --git a/node/utils/Minify.js b/node/utils/Minify.js | |
index fd1dd07..70ccc15 100644 | |
--- a/node/utils/Minify.js | |
+++ b/node/utils/Minify.js | |
@@ -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 server = require('../server'); | |
var os = require('os'); | |
@@ -233,24 +233,13 @@ exports.minifyJS = function(req, res, jsFilename) | |
//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; | |
- | |
+ //gzip file if we're on a unix system | |
+ zlib.gzip(result, function(err, compressedResult){ | |
if(ERR(err, callback)) return; | |
fs.writeFile("../var/minified_" + jsFilename + ".gz", compressedResult, callback); | |
}); | |
} | |
- //skip this step on windows | |
- else | |
- { | |
- callback(); | |
- } | |
- } | |
],callback); | |
} | |
], function(err) | |
diff --git a/package.json b/package.json | |
index 0a73b92..900b55c 100644 | |
--- a/package.json | |
+++ b/package.json | |
@@ -17,7 +17,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", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment