Skip to content

Commit f0f1bd7

Browse files
asudohclmath
authored andcommitted
Fix errors when building Bootstrap CSS. Add support for url containing # and ?. Add support for url starting with ../
1 parent 2c97f59 commit f0f1bd7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tasks/amdserialize.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ module.exports = function (grunt) {
4444
// Process images included in css with url() param.
4545
if (/.css$/.test(filepath)) {
4646
var fileDir = filepath.replace(/[^\/]*$/, "");
47-
var urlRE = /url\(['"]?([^\)'"]*)/g;
47+
var urlRE = /url\(['"]?([^\)'"\?#]*)/g;
4848
var match = null;
49+
50+
// This is needed in case of relative path using ../, because grunt.file.copy while try to go down to
51+
// fileDir before going up with ../ So if fileDir does not exist grunt.file.copy fails.
52+
grunt.file.mkdir(fileDir);
53+
4954
// Extra parenthesis in the while condition to silence jshint.
5055
// The assignment is required here to access the matched groups of a global regexp.
5156
while ((match = urlRE.exec(content))) {

0 commit comments

Comments
 (0)