make generated file a little smaller
This commit is contained in:
parent
8c310caf8b
commit
0ccab0463c
1 changed files with 5 additions and 4 deletions
|
|
@ -251,9 +251,9 @@ function addSuffix(options) {
|
||||||
function getWriteFilters(options, projectType) {
|
function getWriteFilters(options, projectType) {
|
||||||
var filters = [
|
var filters = [
|
||||||
copy.filter.moduleDefines,
|
copy.filter.moduleDefines,
|
||||||
inlineTextModules,
|
|
||||||
removeUseStrict,
|
removeUseStrict,
|
||||||
removeLicenceComments
|
removeLicenceComments,
|
||||||
|
inlineTextModules
|
||||||
];
|
];
|
||||||
|
|
||||||
if (options.filters)
|
if (options.filters)
|
||||||
|
|
@ -465,7 +465,8 @@ var detectTextModules = function(input, source) {
|
||||||
var module = source.isLocation ? source.path : source;
|
var module = source.isLocation ? source.path : source;
|
||||||
|
|
||||||
input = input.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
input = input.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
||||||
input = '"' + input.replace(/\n/g, '\\n\\\n') + '"';
|
input = input.replace(/\n\s+/g, "\n");
|
||||||
|
input = '"' + input.replace(/\n/g, '\\\n') + '"';
|
||||||
textModules[module] = input;
|
textModules[module] = input;
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
|
@ -543,7 +544,7 @@ function removeUseStrict(text) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeLicenceComments(text) {
|
function removeLicenceComments(text) {
|
||||||
return text.replace(/(;)\s*\/\*[\d\D]*?\*\//g, "$1");
|
return text.replace(/(?:(;)|\n)\s*\/\*[\d\D]*?\*\/|\n\s*\/\/.*/g, "$1");
|
||||||
}
|
}
|
||||||
|
|
||||||
function namespace(ns) {
|
function namespace(ns) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue