mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 12:42:36 +01:00
Dont print
This commit is contained in:
parent
33bb86ee85
commit
92b691d19b
12
Gruntfile.js
12
Gruntfile.js
@ -6,36 +6,34 @@ module.exports = function(grunt) {
|
|||||||
options: {
|
options: {
|
||||||
process: function(src, filepath) {
|
process: function(src, filepath) {
|
||||||
var basepath = filepath.substring(7, filepath.lastIndexOf('/') + 1);
|
var basepath = filepath.substring(7, filepath.lastIndexOf('/') + 1);
|
||||||
|
|
||||||
console.log(filepath);
|
|
||||||
// Fix relative paths for css files
|
// Fix relative paths for css files
|
||||||
if(filepath.indexOf('.css', filepath.length - 4) !== -1) {
|
if(filepath.indexOf('.css', filepath.length - 4) !== -1) {
|
||||||
return src.replace(/(url\s*[\("']+)\s*([^'"\)]+)(['"\)]+;?)/gi, function(match, start, url, end, offset, string) {
|
return src.replace(/(url\s*[\("']+)\s*([^'"\)]+)(['"\)]+;?)/gi, function(match, start, url, end, offset, string) {
|
||||||
if(url.indexOf('data:') === 0) {
|
if(url.indexOf('data:') === 0) {
|
||||||
// Skip data urls
|
// Skip data urls
|
||||||
return match;
|
return match;
|
||||||
|
|
||||||
} else if(url.indexOf('/') === 0) {
|
} else if(url.indexOf('/') === 0) {
|
||||||
// Skip absolute urls
|
// Skip absolute urls
|
||||||
return match;
|
return match;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return start + basepath + url + end;
|
return start + basepath + url + end;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fix source maps locations
|
// Fix source maps locations
|
||||||
} else if(filepath.indexOf('.js', filepath.length - 4) !== -1) {
|
} else if(filepath.indexOf('.js', filepath.length - 4) !== -1) {
|
||||||
return src.replace(/(\/[*\/][#@]\s*sourceMappingURL=)([^\s]+)/gi, function(match, start, url, offset, string) {
|
return src.replace(/(\/[*\/][#@]\s*sourceMappingURL=)([^\s]+)/gi, function(match, start, url, offset, string) {
|
||||||
if(url.indexOf('/') === 0) {
|
if(url.indexOf('/') === 0) {
|
||||||
// Skip absolute urls
|
// Skip absolute urls
|
||||||
return match;
|
return match;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return start + basepath + url;
|
return start + basepath + url;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Don't do anything for unknown file types
|
// Don't do anything for unknown file types
|
||||||
} else {
|
} else {
|
||||||
return src;
|
return src;
|
||||||
|
Loading…
Reference in New Issue
Block a user