diff --git a/lib/loader.js b/lib/loader.js index 6cee1ef5..629c9977 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -132,7 +132,7 @@ module.exports = function loader(content, map) { return `" + escape(require(${loaderUtils.stringifyRequest( this, urlRequest - )})) + "${url.substr(idx)}`; + )}) + "${url.substr(idx)}") + "`; } urlRequest = url; return `" + escape(require(${loaderUtils.stringifyRequest( diff --git a/test/urlTest.js b/test/urlTest.js index cd003c76..a75bc87d 100644 --- a/test/urlTest.js +++ b/test/urlTest.js @@ -99,11 +99,11 @@ describe('url', () => { ); test( 'font face', - "@font-face { src: url(regular.woff) format('woff'), url(~truetype/regular.ttf) format('truetype') }", + "@font-face { src: url(regular.woff) format('woff'), url(~truetype/regular.ttf) format('truetype'), url('Mark Simonson - Proxima Nova Alt Regular-webfont.eot?#iefix') format('embedded-opentype'), url('webfont.svg#svgFontName') format('svg'), url('webfont.woff2?foo=bar') format('woff2'); }", [ [ 1, - "@font-face { src: url({./regular.woff}) format('woff'), url({truetype/regular.ttf}) format('truetype') }", + "@font-face { src: url({./regular.woff}) format('woff'), url({truetype/regular.ttf}) format('truetype'), url(\"{./Mark Simonson - Proxima Nova Alt Regular-webfont.eot}?#iefix\") format('embedded-opentype'), url({./webfont.svg}#svgFontName) format('svg'), url({./webfont.woff2?foo=bar}) format('woff2'); }", '', ], ]