remove whitespace from css during the build
This commit is contained in:
parent
e0a2d5688c
commit
6c7ea4a2f7
1 changed files with 9 additions and 2 deletions
|
|
@ -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 "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue