From 6c7ea4a2f733272cf98acb896b89816a3a563ee0 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 6 Apr 2013 16:09:54 +0400 Subject: [PATCH] remove whitespace from css during the build --- Makefile.dryice.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 48d6591c..d544aad6 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -470,9 +470,16 @@ var detectTextModules = function(input, source) { input = input.toString(); var module = source.isLocation ? source.path : source; - + input = input.replace(/\\/g, "\\\\").replace(/"/g, '\\"'); - input = '"' + input.replace(/\r?\n/g, '\\n') + '"'; + if (/\.css$/.test(module)) { + // remove unnecessary whitespace from css + input = input.replace(/\n\s+/g, "\n"); + input = '"' + input.replace(/\r?\n/g, '\\\n') + '"'; + } else { + // but don't break other files! + input = '"' + input.replace(/\r?\n/g, '\\n\\\n') + '"'; + } textModules[module] = input; return "";