Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ module.exports = function(content, map) {
if(idx > 0) { // idx === 0 is catched by isUrlRequest
// in cases like url('webfont.eot?#iefix')
urlRequest = url.substr(0, idx);
return "\" + escape(require(" + loaderUtils.stringifyRequest(this, urlRequest) + ")) + \"" +
url.substr(idx);
return "\" + escape(require(" + loaderUtils.stringifyRequest(this, urlRequest) + ") + \"" +
url.substr(idx) + "\") + \"";
}
urlRequest = url;
return "\" + escape(require(" + loaderUtils.stringifyRequest(this, urlRequest) + ")) + \"";
Expand Down
3 changes: 3 additions & 0 deletions test/urlTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ describe("url", function() {
test("font face with url", "@font-face { src: url(regular.woff) format('woff'), url(~truetype/regular.ttf) format('truetype') }", [
[1, "@font-face { src: url(regular.woff) format('woff'), url(~truetype/regular.ttf) format('truetype') }", ""]
], "?-url");
test("font face with url", '@font-face { src: url("bold regular.woff?#iefix") format("woff") }', [
[1, '@font-face { src: url("{./bold regular.woff}?#iefix") format("woff") }', ""]
], "", { './module': "data:font/ttf;base64,AAEAAAATAQAABAAwR1BPU+Df" });
test("font face with url", "@font-face { src: url(Mark Simonson - Proxima Nova Alt Regular-webfont.eot?#iefix) format('embedded-opentype'), url(~opentype/Mark Simonson - Proxima Nova Alt Regular-webfont.eot?#iefix) format('embedded-opentype') }", [
[1, "@font-face { src: url(Mark Simonson - Proxima Nova Alt Regular-webfont.eot?#iefix) format('embedded-opentype'), url(~opentype/Mark Simonson - Proxima Nova Alt Regular-webfont.eot?#iefix) format('embedded-opentype') }", ""]
], "?-url");
Expand Down