diff --git a/README.md b/README.md index 53fbabc0..b68189a6 100644 --- a/README.md +++ b/README.md @@ -55,12 +55,18 @@ You can also use the css-loader results directly as a string, such as in Angular **webpack.config.js** ```js -{ -   test: /\.css$/, -   use: [ -     'to-string-loader', - 'css-loader' -   ] +module.exports = { + module: { + rules: [ + { + test: /\.css$/, + use: [ +   'to-string-loader', + 'css-loader' +   ] + } + ] + } } ``` @@ -106,13 +112,20 @@ It's useful when you, for instance, need to post process the CSS as a string. ### `url` -To disable `url()` resolving by `css-loader` set the option to `false`. +Enable/disable `url()` resolving. Absolute `urls` are not resolving by default. -To be compatible with existing css files (if not in CSS Module mode). +Examples resolutions: ``` url(image.png) => require('./image.png') +url(./image.png) => require('./image.png') +``` + +To import styles from a `node_modules` path (include `resolve.modules`) and for `alias`, prefix it with a `~`: + +``` url(~module/image.png) => require('module/image.png') +url(~aliasDirectory/image.png) => require('otherDirectory/image.png') ``` ### `import` @@ -184,13 +197,6 @@ exports.locals = { CamelCase is recommended for local selectors. They are easier to use within the imported JS module. -`url()` URLs in block scoped (`:local .abc`) rules behave like requests in modules. - -``` -file.png => ./file.png -~module/file.png => module/file.png -``` - You can use `:local(#someId)`, but this is not recommended. Use classes instead of ids. ##### `Composing` diff --git a/lib/loader.js b/lib/loader.js index eb9c6fbe..8ca549eb 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -72,25 +72,7 @@ module.exports = function loader(content, map, meta) { plugins.push( modulesValues, - localByDefault({ - mode, - rewriteUrl(global, url) { - if (resolveUrl) { - // eslint-disable-next-line no-param-reassign - url = url.trim(); - - if (!url.replace(/\s/g, '').length || !isUrlRequest(url)) { - return url; - } - - if (global) { - return urlToRequest(url); - } - } - - return url; - }, - }), + localByDefault({ mode }), extractImports(), modulesScope({ generateScopedName: function generateScopedName(exportName) { @@ -117,7 +99,11 @@ module.exports = function loader(content, map, meta) { } if (resolveUrl) { - plugins.push(urlParser()); + plugins.push( + urlParser({ + filter: (value) => isUrlRequest(value), + }) + ); } plugins.push(icssParser()); @@ -251,7 +237,7 @@ module.exports = function loader(content, map, meta) { return `" + escape(require(${stringifyRequest( this, - normalizedUrl + urlToRequest(normalizedUrl) )})${hash ? ` + ${hash}` : ''}) + "`; } ); diff --git a/lib/plugins/postcss-url-parser.js b/lib/plugins/postcss-url-parser.js index d7824b94..1dbcf84a 100644 --- a/lib/plugins/postcss-url-parser.js +++ b/lib/plugins/postcss-url-parser.js @@ -1,6 +1,5 @@ const postcss = require('postcss'); const valueParser = require('postcss-value-parser'); -const { isUrlRequest } = require('loader-utils'); const pluginName = 'postcss-url-parser'; @@ -97,11 +96,9 @@ function uniq(array) { module.exports = postcss.plugin( pluginName, - () => + (options) => function process(css, result) { - const traversed = walkDeclsWithUrl(css, result, (value) => - isUrlRequest(value) - ); + const traversed = walkDeclsWithUrl(css, result, options.filter); const paths = uniq(flatten(traversed.map((item) => item.values))); if (paths.length === 0) { diff --git a/test/__snapshots__/url-option.test.js.snap b/test/__snapshots__/url-option.test.js.snap index c01fece0..28478e59 100644 --- a/test/__snapshots__/url-option.test.js.snap +++ b/test/__snapshots__/url-option.test.js.snap @@ -49,7 +49,7 @@ Array [ } .class { - background: green /* url(~package/img.png) */ url(./other-img.png) xyz; + background: green url(~package/img.png) url(./other-img.png) xyz; } .class { @@ -96,7 +96,7 @@ Array [ src: url(./font.woff) format('woff'), url('./font.woff2') format('woff2'), url(\\"./font.eot\\") format('eot'), - /*url(~package/font.ttf) format('truetype'), */ + url(~package/font.ttf) format('truetype'), url(\\"./font with spaces.eot\\") format(\\"embedded-opentype\\"), url('./font.svg#svgFontName') format('svg'), url('./font.woff2?foo=bar') format('woff2'), @@ -192,6 +192,26 @@ b { background: ___CSS_LOADER_IMPORT___INDEX___; background: ___CSS_LOADER_IMPORT___99999___; } + +.pure-url { + background: url('img-simple.png'); +} + +.not-resolved { + background: url('/img-simple.png'); +} + +.above-below { + background: url('../url/img-simple.png'); +} + +.tilde { + background: url('~package/img.png'); +} + +.aliases { + background: url('~aliasesImg/img.png') ; +} ", "", ], @@ -204,7 +224,7 @@ exports[`url option false: module 1`] = ` exports.i(require(\\"-!../../../index.js??ref--4-0!./imported.css\\"), \\"\\"); // module -exports.push([module.id, \\".class {\\\\n background: url('./img.png');\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(./img.png);\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png#hash\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\n \\\\\\"./img.png\\\\\\"\\\\n );\\\\n}\\\\n\\\\n.class {\\\\n background: green url( './img.png' ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url( \\\\\\"./img.png\\\\\\" ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url( ./img.png ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green /* url(~package/img.png) */ url(./other-img.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url( \\\\\\"./img img.png\\\\\\" ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url( './img img.png' ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(/img.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,#filter');\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter');\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url(#highlight);\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url('#line-marker');\\\\n}\\\\n\\\\n@font-face {\\\\n src: url(./font.woff) format('woff'),\\\\n url('./font.woff2') format('woff2'),\\\\n url(\\\\\\"./font.eot\\\\\\") format('eot'),\\\\n /*url(~package/font.ttf) format('truetype'), */\\\\n url(\\\\\\"./font with spaces.eot\\\\\\") format(\\\\\\"embedded-opentype\\\\\\"),\\\\n url('./font.svg#svgFontName') format('svg'),\\\\n url('./font.woff2?foo=bar') format('woff2'),\\\\n url(\\\\\\"./font.eot?#iefix\\\\\\") format('embedded-opentype'),\\\\n url(\\\\\\"./font with spaces.eot?#iefix\\\\\\") format('embedded-opentype');\\\\n}\\\\n\\\\n@media (min-width: 500px) {\\\\n body {\\\\n background: url(\\\\\\"./img.png\\\\\\");\\\\n }\\\\n}\\\\n\\\\na {\\\\n content: \\\\\\"do not use url(path)\\\\\\";\\\\n}\\\\n\\\\nb {\\\\n content: 'do not \\\\\\"use\\\\\\" url(path)';\\\\n}\\\\n\\\\n@keyframes anim {\\\\n background: green url('./img.png') xyz;\\\\n}\\\\n\\\\n.a {\\\\n background-image: -webkit-image-set(url('./img1x.png') 1x, url('./img2x.png') 2x)\\\\n}\\\\n\\\\n.a {\\\\n background-image: image-set(url('./img1x.png') 1x, url('./img2x.png') 2x)\\\\n}\\\\n\\\\n.class {\\\\n background: green url() xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url('') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\\\"\\\\\\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(' ') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\n \\\\n ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png?foo\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png?foo=bar\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png?foo=bar#hash\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png?foo=bar#hash\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png?\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url('./img.png') url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\") url('./img.png');\\\\n}\\\\n\\\\n.class {\\\\n background: ___CSS_LOADER_URL___;\\\\n background: ___CSS_LOADER_URL___INDEX___;\\\\n background: ___CSS_LOADER_URL___99999___;\\\\n background: ___CSS_LOADER_IMPORT___;\\\\n background: ___CSS_LOADER_IMPORT___INDEX___;\\\\n background: ___CSS_LOADER_IMPORT___99999___;\\\\n}\\\\n\\", \\"\\"]); +exports.push([module.id, \\".class {\\\\n background: url('./img.png');\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(./img.png);\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png#hash\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\n \\\\\\"./img.png\\\\\\"\\\\n );\\\\n}\\\\n\\\\n.class {\\\\n background: green url( './img.png' ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url( \\\\\\"./img.png\\\\\\" ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url( ./img.png ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(~package/img.png) url(./other-img.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url( \\\\\\"./img img.png\\\\\\" ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url( './img img.png' ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(/img.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,#filter');\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter');\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url(#highlight);\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url('#line-marker');\\\\n}\\\\n\\\\n@font-face {\\\\n src: url(./font.woff) format('woff'),\\\\n url('./font.woff2') format('woff2'),\\\\n url(\\\\\\"./font.eot\\\\\\") format('eot'),\\\\n url(~package/font.ttf) format('truetype'),\\\\n url(\\\\\\"./font with spaces.eot\\\\\\") format(\\\\\\"embedded-opentype\\\\\\"),\\\\n url('./font.svg#svgFontName') format('svg'),\\\\n url('./font.woff2?foo=bar') format('woff2'),\\\\n url(\\\\\\"./font.eot?#iefix\\\\\\") format('embedded-opentype'),\\\\n url(\\\\\\"./font with spaces.eot?#iefix\\\\\\") format('embedded-opentype');\\\\n}\\\\n\\\\n@media (min-width: 500px) {\\\\n body {\\\\n background: url(\\\\\\"./img.png\\\\\\");\\\\n }\\\\n}\\\\n\\\\na {\\\\n content: \\\\\\"do not use url(path)\\\\\\";\\\\n}\\\\n\\\\nb {\\\\n content: 'do not \\\\\\"use\\\\\\" url(path)';\\\\n}\\\\n\\\\n@keyframes anim {\\\\n background: green url('./img.png') xyz;\\\\n}\\\\n\\\\n.a {\\\\n background-image: -webkit-image-set(url('./img1x.png') 1x, url('./img2x.png') 2x)\\\\n}\\\\n\\\\n.a {\\\\n background-image: image-set(url('./img1x.png') 1x, url('./img2x.png') 2x)\\\\n}\\\\n\\\\n.class {\\\\n background: green url() xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url('') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\\\"\\\\\\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(' ') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\n \\\\n ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png?foo\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png?foo=bar\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png?foo=bar#hash\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png?foo=bar#hash\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\\\\\"./img.png?\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url('./img.png') url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\") url('./img.png');\\\\n}\\\\n\\\\n.class {\\\\n background: ___CSS_LOADER_URL___;\\\\n background: ___CSS_LOADER_URL___INDEX___;\\\\n background: ___CSS_LOADER_URL___99999___;\\\\n background: ___CSS_LOADER_IMPORT___;\\\\n background: ___CSS_LOADER_IMPORT___INDEX___;\\\\n background: ___CSS_LOADER_IMPORT___99999___;\\\\n}\\\\n\\\\n.pure-url {\\\\n background: url('img-simple.png');\\\\n}\\\\n\\\\n.not-resolved {\\\\n background: url('/img-simple.png');\\\\n}\\\\n\\\\n.above-below {\\\\n background: url('../url/img-simple.png');\\\\n}\\\\n\\\\n.tilde {\\\\n background: url('~package/img.png');\\\\n}\\\\n\\\\n.aliases {\\\\n background: url('~aliasesImg/img.png') ;\\\\n}\\\\n\\", \\"\\"]); // exports " @@ -212,9 +232,264 @@ exports.push([module.id, \\".class {\\\\n background: url('./img.png');\\\\n}\\ exports[`url option false: warnings 1`] = `Array []`; -exports[`url option true: errors 1`] = `Array []`; +exports[`url option true and modules \`false\`: errors 1`] = `Array []`; -exports[`url option true: module (evaluated) 1`] = ` +exports[`url option true and modules \`false\`: module (evaluated) 1`] = ` +Array [ + Array [ + 2, + ".bar { + background: url(/webpack/public/path/img-from-imported.png); +} +", + "", + ], + Array [ + 1, + ".class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: url(/webpack/public/path/img.png#hash); +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: green url(/webpack/public/path/img.png) xyz; +} + +.class { + background: green url(/webpack/public/path/img.png) xyz; +} + +.class { + background: green url(/webpack/public/path/img.png) xyz; +} + +.class { + background: green url(/webpack/public/path/img.png) url(/webpack/public/path/other-img.png) xyz; +} + +.class { + background: green url(\\"/webpack/public/path/img img.png\\") xyz; +} + +.class { + background: green url(\\"/webpack/public/path/img img.png\\") xyz; +} + +.class { + background: green url(/img.png) xyz; +} + +.class { + background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz; +} + +.class { + background-image: url(\\"data:image/svg+xml;charset=utf-8,\\"); +} + +.class { + background-image: url(\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\"); +} + +.class { + filter: url('data:image/svg+xml;charset=utf-8,#filter'); +} + +.class { + filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter'); +} + +.highlight { + filter: url(#highlight); +} + +.highlight { + filter: url('#line-marker'); +} + +@font-face { + src: url(/webpack/public/path/font.woff) format('woff'), + url(/webpack/public/path/font.woff2) format('woff2'), + url(/webpack/public/path/font.eot) format('eot'), + url(/webpack/public/path/font.ttf) format('truetype'), + url(\\"/webpack/public/path/font with spaces.eot\\") format(\\"embedded-opentype\\"), + url(/webpack/public/path/font.svg#svgFontName) format('svg'), + url(/webpack/public/path/font.woff2) format('woff2'), + url(/webpack/public/path/font.eot?#iefix) format('embedded-opentype'), + url(\\"/webpack/public/path/font with spaces.eot?#iefix\\") format('embedded-opentype'); +} + +@media (min-width: 500px) { + body { + background: url(/webpack/public/path/img.png); + } +} + +a { + content: \\"do not use url(path)\\"; +} + +b { + content: 'do not \\"use\\" url(path)'; +} + +@keyframes anim { + background: green url(/webpack/public/path/img.png) xyz; +} + +.a { + background-image: -webkit-image-set(url(/webpack/public/path/img1x.png) 1x, url(/webpack/public/path/img2x.png) 2x) +} + +.a { + background-image: image-set(url(/webpack/public/path/img1x.png) 1x, url(/webpack/public/path/img2x.png) 2x) +} + +.class { + background: green url() xyz; +} + +.class { + background: green url('') xyz; +} + +.class { + background: green url(\\"\\") xyz; +} + +.class { + background: green url(' ') xyz; +} + +.class { + background: green url( + + ) xyz; +} + +.class { + background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz; +} + +.class { + background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz; +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: url(/webpack/public/path/img.png#hash); +} + +.class { + background: url(/webpack/public/path/img.png#hash); +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background-image: url(/webpack/public/path/img.png) url(\\"data:image/svg+xml;charset=utf-8,\\") url(/webpack/public/path/img.png); +} + +.class { + background: ___CSS_LOADER_URL___; + background: ___CSS_LOADER_URL___INDEX___; + background: ___CSS_LOADER_URL___99999___; + background: ___CSS_LOADER_IMPORT___; + background: ___CSS_LOADER_IMPORT___INDEX___; + background: ___CSS_LOADER_IMPORT___99999___; +} + +.pure-url { + background: url(/webpack/public/path/img-simple.png); +} + +.not-resolved { + background: url('/img-simple.png'); +} + +.above-below { + background: url(/webpack/public/path/img-simple.png); +} + +.tilde { + background: url(/webpack/public/path/img.png); +} + +.aliases { + background: url(/webpack/public/path/img.png); +} +", + "", + ], +] +`; + +exports[`url option true and modules \`false\`: module 1`] = ` +"var escape = require(\\"../../../lib/runtime/escape.js\\"); +exports = module.exports = require(\\"../../../lib/runtime/api.js\\")(false); +// imports +exports.i(require(\\"-!../../../index.js??ref--4-0!./imported.css\\"), \\"\\"); + +// module +exports.push([module.id, \\".class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"package/img.png\\")) + \\") url(\\" + escape(require(\\"./other-img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(/img.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,#filter');\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter');\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url(#highlight);\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url('#line-marker');\\\\n}\\\\n\\\\n@font-face {\\\\n src: url(\\" + escape(require(\\"./font.woff\\")) + \\") format('woff'),\\\\n url(\\" + escape(require(\\"./font.woff2\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\")) + \\") format('eot'),\\\\n url(\\" + escape(require(\\"package/font.ttf\\")) + \\") format('truetype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\")) + \\") format(\\\\\\"embedded-opentype\\\\\\"),\\\\n url(\\" + escape(require(\\"./font.svg\\") + \\"#svgFontName\\") + \\") format('svg'),\\\\n url(\\" + escape(require(\\"./font.woff2?foo=bar\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype');\\\\n}\\\\n\\\\n@media (min-width: 500px) {\\\\n body {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n }\\\\n}\\\\n\\\\na {\\\\n content: \\\\\\"do not use url(path)\\\\\\";\\\\n}\\\\n\\\\nb {\\\\n content: 'do not \\\\\\"use\\\\\\" url(path)';\\\\n}\\\\n\\\\n@keyframes anim {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.a {\\\\n background-image: -webkit-image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n.a {\\\\n background-image: image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n.class {\\\\n background: green url() xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url('') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\\\"\\\\\\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(' ') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\n \\\\n ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\" + escape(require(\\"./img.png\\")) + \\") url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\") url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: ___CSS_LOADER_URL___;\\\\n background: ___CSS_LOADER_URL___INDEX___;\\\\n background: ___CSS_LOADER_URL___99999___;\\\\n background: ___CSS_LOADER_IMPORT___;\\\\n background: ___CSS_LOADER_IMPORT___INDEX___;\\\\n background: ___CSS_LOADER_IMPORT___99999___;\\\\n}\\\\n\\\\n.pure-url {\\\\n background: url(\\" + escape(require(\\"./img-simple.png\\")) + \\");\\\\n}\\\\n\\\\n.not-resolved {\\\\n background: url('/img-simple.png');\\\\n}\\\\n\\\\n.above-below {\\\\n background: url(\\" + escape(require(\\"../url/img-simple.png\\")) + \\");\\\\n}\\\\n\\\\n.tilde {\\\\n background: url(\\" + escape(require(\\"package/img.png\\")) + \\");\\\\n}\\\\n\\\\n.aliases {\\\\n background: url(\\" + escape(require(\\"aliasesImg/img.png\\")) + \\");\\\\n}\\\\n\\", \\"\\"]); + +// exports +" +`; + +exports[`url option true and modules \`false\`: warnings 1`] = ` +Array [ + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(120:3) Unable to find uri in 'background: green url() xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(124:3) Unable to find uri in 'background: green url('') xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(128:3) Unable to find uri in 'background: green url(\\"\\") xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(132:3) Unable to find uri in 'background: green url(' ') xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(136:3) Unable to find uri in 'background: green url( + ) xyz'", +] +`; + +exports[`url option true and modules \`global\`: errors 1`] = `Array []`; + +exports[`url option true and modules \`global\`: module (evaluated) 1`] = ` Array [ Array [ 2, @@ -259,7 +534,7 @@ Array [ } .class { - background: green url(/webpack/public/path/other-img.png) xyz; + background: green url(/webpack/public/path/img.png) url(/webpack/public/path/other-img.png) xyz; } .class { @@ -306,7 +581,7 @@ Array [ src: url(/webpack/public/path/font.woff) format('woff'), url(/webpack/public/path/font.woff2) format('woff2'), url(/webpack/public/path/font.eot) format('eot'), - + url(/webpack/public/path/font.ttf) format('truetype'), url(\\"/webpack/public/path/font with spaces.eot\\") format(\\"embedded-opentype\\"), url(/webpack/public/path/font.svg#svgFontName) format('svg'), url(/webpack/public/path/font.woff2) format('woff2'), @@ -402,6 +677,811 @@ b { background: ___CSS_LOADER_IMPORT___INDEX___; background: ___CSS_LOADER_IMPORT___99999___; } + +.pure-url { + background: url(/webpack/public/path/img-simple.png); +} + +.not-resolved { + background: url('/img-simple.png'); +} + +.above-below { + background: url(/webpack/public/path/img-simple.png); +} + +.tilde { + background: url(/webpack/public/path/img.png); +} + +.aliases { + background: url(/webpack/public/path/img.png); +} +", + "", + ], +] +`; + +exports[`url option true and modules \`global\`: module 1`] = ` +"var escape = require(\\"../../../lib/runtime/escape.js\\"); +exports = module.exports = require(\\"../../../lib/runtime/api.js\\")(false); +// imports +exports.i(require(\\"-!../../../index.js??ref--4-0!./imported.css\\"), \\"\\"); + +// module +exports.push([module.id, \\".class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"package/img.png\\")) + \\") url(\\" + escape(require(\\"./other-img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(/img.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,#filter');\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter');\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url(#highlight);\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url('#line-marker');\\\\n}\\\\n\\\\n@font-face {\\\\n src: url(\\" + escape(require(\\"./font.woff\\")) + \\") format('woff'),\\\\n url(\\" + escape(require(\\"./font.woff2\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\")) + \\") format('eot'),\\\\n url(\\" + escape(require(\\"package/font.ttf\\")) + \\") format('truetype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\")) + \\") format(\\\\\\"embedded-opentype\\\\\\"),\\\\n url(\\" + escape(require(\\"./font.svg\\") + \\"#svgFontName\\") + \\") format('svg'),\\\\n url(\\" + escape(require(\\"./font.woff2?foo=bar\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype');\\\\n}\\\\n\\\\n@media (min-width: 500px) {\\\\n body {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n }\\\\n}\\\\n\\\\na {\\\\n content: \\\\\\"do not use url(path)\\\\\\";\\\\n}\\\\n\\\\nb {\\\\n content: 'do not \\\\\\"use\\\\\\" url(path)';\\\\n}\\\\n\\\\n@keyframes anim {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.a {\\\\n background-image: -webkit-image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n.a {\\\\n background-image: image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n.class {\\\\n background: green url() xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url('') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\\\"\\\\\\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(' ') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\n \\\\n ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\" + escape(require(\\"./img.png\\")) + \\") url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\") url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: ___CSS_LOADER_URL___;\\\\n background: ___CSS_LOADER_URL___INDEX___;\\\\n background: ___CSS_LOADER_URL___99999___;\\\\n background: ___CSS_LOADER_IMPORT___;\\\\n background: ___CSS_LOADER_IMPORT___INDEX___;\\\\n background: ___CSS_LOADER_IMPORT___99999___;\\\\n}\\\\n\\\\n.pure-url {\\\\n background: url(\\" + escape(require(\\"./img-simple.png\\")) + \\");\\\\n}\\\\n\\\\n.not-resolved {\\\\n background: url('/img-simple.png');\\\\n}\\\\n\\\\n.above-below {\\\\n background: url(\\" + escape(require(\\"../url/img-simple.png\\")) + \\");\\\\n}\\\\n\\\\n.tilde {\\\\n background: url(\\" + escape(require(\\"package/img.png\\")) + \\");\\\\n}\\\\n\\\\n.aliases {\\\\n background: url(\\" + escape(require(\\"aliasesImg/img.png\\")) + \\");\\\\n}\\\\n\\", \\"\\"]); + +// exports +" +`; + +exports[`url option true and modules \`global\`: warnings 1`] = ` +Array [ + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(120:3) Unable to find uri in 'background: green url() xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(124:3) Unable to find uri in 'background: green url('') xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(128:3) Unable to find uri in 'background: green url(\\"\\") xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(132:3) Unable to find uri in 'background: green url(' ') xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(136:3) Unable to find uri in 'background: green url( + ) xyz'", +] +`; + +exports[`url option true and modules \`local\`: errors 1`] = `Array []`; + +exports[`url option true and modules \`local\`: module (evaluated) 1`] = ` +Array [ + Array [ + 2, + "._2y8zdp_B3r6R32gVxIJYJG { + background: url(/webpack/public/path/img-from-imported.png); +} +", + "", + ], + Array [ + 1, + "._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png#hash); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(/webpack/public/path/img.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(/webpack/public/path/img.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(/webpack/public/path/img.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(/webpack/public/path/img.png) url(/webpack/public/path/other-img.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(\\"/webpack/public/path/img img.png\\") xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(\\"/webpack/public/path/img img.png\\") xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(/img.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background-image: url(\\"data:image/svg+xml;charset=utf-8,\\"); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background-image: url(\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\"); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + filter: url('data:image/svg+xml;charset=utf-8,#filter'); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter'); +} + +.lml_5t-nQdGlKc9OtKjUO { + filter: url(#highlight); +} + +.lml_5t-nQdGlKc9OtKjUO { + filter: url('#line-marker'); +} + +@font-face { + src: url(/webpack/public/path/font.woff) format('woff'), + url(/webpack/public/path/font.woff2) format('woff2'), + url(/webpack/public/path/font.eot) format('eot'), + url(/webpack/public/path/font.ttf) format('truetype'), + url(\\"/webpack/public/path/font with spaces.eot\\") format(\\"embedded-opentype\\"), + url(/webpack/public/path/font.svg#svgFontName) format('svg'), + url(/webpack/public/path/font.woff2) format('woff2'), + url(/webpack/public/path/font.eot?#iefix) format('embedded-opentype'), + url(\\"/webpack/public/path/font with spaces.eot?#iefix\\") format('embedded-opentype'); +} + +@media (min-width: 500px) { + body { + background: url(/webpack/public/path/img.png); + } +} + +a { + content: \\"do not use url(path)\\"; +} + +b { + content: 'do not \\"use\\" url(path)'; +} + +@keyframes O9YPhh3OZdzrkj25z-J92 { + background: green url(/webpack/public/path/img.png) xyz; +} + +._1fj5hnOVZ8KZVIGyZbPW3p { + background-image: -webkit-image-set(url(/webpack/public/path/img1x.png) 1x, url(/webpack/public/path/img2x.png) 2x) +} + +._1fj5hnOVZ8KZVIGyZbPW3p { + background-image: image-set(url(/webpack/public/path/img1x.png) 1x, url(/webpack/public/path/img2x.png) 2x) +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url() xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url('') xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(\\"\\") xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(' ') xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url( + + ) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png#hash); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png#hash); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background-image: url(/webpack/public/path/img.png) url(\\"data:image/svg+xml;charset=utf-8,\\") url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: ___CSS_LOADER_URL___; + background: ___CSS_LOADER_URL___INDEX___; + background: ___CSS_LOADER_URL___99999___; + background: ___CSS_LOADER_IMPORT___; + background: ___CSS_LOADER_IMPORT___INDEX___; + background: ___CSS_LOADER_IMPORT___99999___; +} + +._2rb58RF5u2ij-3X8XSJaVP { + background: url(/webpack/public/path/img-simple.png); +} + +.mrf4tRz4T71pNku_3IMH3 { + background: url('/img-simple.png'); +} + +.c5dNFA35opKWoGz7aRj0k { + background: url(/webpack/public/path/img-simple.png); +} + +._2Q5a0g3xEHAboOADfIxHa5 { + background: url(/webpack/public/path/img.png); +} + +._2TX-7lb63hK5h5DzELIAbU { + background: url(/webpack/public/path/img.png); +} +", + "", + ], +] +`; + +exports[`url option true and modules \`local\`: module 1`] = ` +"var escape = require(\\"../../../lib/runtime/escape.js\\"); +exports = module.exports = require(\\"../../../lib/runtime/api.js\\")(false); +// imports +exports.i(require(\\"-!../../../index.js??ref--4-0!./imported.css\\"), \\"\\"); + +// module +exports.push([module.id, \\"._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"package/img.png\\")) + \\") url(\\" + escape(require(\\"./other-img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(/img.png) xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\\\\\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n filter: url('data:image/svg+xml;charset=utf-8,#filter');\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter');\\\\n}\\\\n\\\\n.lml_5t-nQdGlKc9OtKjUO {\\\\n filter: url(#highlight);\\\\n}\\\\n\\\\n.lml_5t-nQdGlKc9OtKjUO {\\\\n filter: url('#line-marker');\\\\n}\\\\n\\\\n@font-face {\\\\n src: url(\\" + escape(require(\\"./font.woff\\")) + \\") format('woff'),\\\\n url(\\" + escape(require(\\"./font.woff2\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\")) + \\") format('eot'),\\\\n url(\\" + escape(require(\\"package/font.ttf\\")) + \\") format('truetype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\")) + \\") format(\\\\\\"embedded-opentype\\\\\\"),\\\\n url(\\" + escape(require(\\"./font.svg\\") + \\"#svgFontName\\") + \\") format('svg'),\\\\n url(\\" + escape(require(\\"./font.woff2?foo=bar\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype');\\\\n}\\\\n\\\\n@media (min-width: 500px) {\\\\n body {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n }\\\\n}\\\\n\\\\na {\\\\n content: \\\\\\"do not use url(path)\\\\\\";\\\\n}\\\\n\\\\nb {\\\\n content: 'do not \\\\\\"use\\\\\\" url(path)';\\\\n}\\\\n\\\\n@keyframes O9YPhh3OZdzrkj25z-J92 {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._1fj5hnOVZ8KZVIGyZbPW3p {\\\\n background-image: -webkit-image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n._1fj5hnOVZ8KZVIGyZbPW3p {\\\\n background-image: image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url() xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url('') xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\\\\\"\\\\\\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(' ') xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\\\n \\\\n ) xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png?foo\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png?\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background-image: url(\\" + escape(require(\\"./img.png\\")) + \\") url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\") url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: ___CSS_LOADER_URL___;\\\\n background: ___CSS_LOADER_URL___INDEX___;\\\\n background: ___CSS_LOADER_URL___99999___;\\\\n background: ___CSS_LOADER_IMPORT___;\\\\n background: ___CSS_LOADER_IMPORT___INDEX___;\\\\n background: ___CSS_LOADER_IMPORT___99999___;\\\\n}\\\\n\\\\n._2rb58RF5u2ij-3X8XSJaVP {\\\\n background: url(\\" + escape(require(\\"./img-simple.png\\")) + \\");\\\\n}\\\\n\\\\n.mrf4tRz4T71pNku_3IMH3 {\\\\n background: url('/img-simple.png');\\\\n}\\\\n\\\\n.c5dNFA35opKWoGz7aRj0k {\\\\n background: url(\\" + escape(require(\\"../url/img-simple.png\\")) + \\");\\\\n}\\\\n\\\\n._2Q5a0g3xEHAboOADfIxHa5 {\\\\n background: url(\\" + escape(require(\\"package/img.png\\")) + \\");\\\\n}\\\\n\\\\n._2TX-7lb63hK5h5DzELIAbU {\\\\n background: url(\\" + escape(require(\\"aliasesImg/img.png\\")) + \\");\\\\n}\\\\n\\", \\"\\"]); + +// exports +exports.locals = { + \\"class\\": \\"_7NvzxsKlD5xT5cUVu5Ad-\\", + \\"highlight\\": \\"lml_5t-nQdGlKc9OtKjUO\\", + \\"a\\": \\"_1fj5hnOVZ8KZVIGyZbPW3p\\", + \\"pure-url\\": \\"_2rb58RF5u2ij-3X8XSJaVP\\", + \\"not-resolved\\": \\"mrf4tRz4T71pNku_3IMH3\\", + \\"above-below\\": \\"c5dNFA35opKWoGz7aRj0k\\", + \\"tilde\\": \\"_2Q5a0g3xEHAboOADfIxHa5\\", + \\"aliases\\": \\"_2TX-7lb63hK5h5DzELIAbU\\", + \\"anim\\": \\"O9YPhh3OZdzrkj25z-J92\\" +};" +`; + +exports[`url option true and modules \`local\`: warnings 1`] = ` +Array [ + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(120:3) Unable to find uri in 'background: green url() xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(124:3) Unable to find uri in 'background: green url('') xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(128:3) Unable to find uri in 'background: green url(\\"\\") xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(132:3) Unable to find uri in 'background: green url(' ') xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(136:3) Unable to find uri in 'background: green url( + ) xyz'", +] +`; + +exports[`url option true and modules \`true\`: errors 1`] = `Array []`; + +exports[`url option true and modules \`true\`: module (evaluated) 1`] = ` +Array [ + Array [ + 2, + "._2y8zdp_B3r6R32gVxIJYJG { + background: url(/webpack/public/path/img-from-imported.png); +} +", + "", + ], + Array [ + 1, + "._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png#hash); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(/webpack/public/path/img.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(/webpack/public/path/img.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(/webpack/public/path/img.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(/webpack/public/path/img.png) url(/webpack/public/path/other-img.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(\\"/webpack/public/path/img img.png\\") xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(\\"/webpack/public/path/img img.png\\") xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(/img.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background-image: url(\\"data:image/svg+xml;charset=utf-8,\\"); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background-image: url(\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\"); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + filter: url('data:image/svg+xml;charset=utf-8,#filter'); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter'); +} + +.lml_5t-nQdGlKc9OtKjUO { + filter: url(#highlight); +} + +.lml_5t-nQdGlKc9OtKjUO { + filter: url('#line-marker'); +} + +@font-face { + src: url(/webpack/public/path/font.woff) format('woff'), + url(/webpack/public/path/font.woff2) format('woff2'), + url(/webpack/public/path/font.eot) format('eot'), + url(/webpack/public/path/font.ttf) format('truetype'), + url(\\"/webpack/public/path/font with spaces.eot\\") format(\\"embedded-opentype\\"), + url(/webpack/public/path/font.svg#svgFontName) format('svg'), + url(/webpack/public/path/font.woff2) format('woff2'), + url(/webpack/public/path/font.eot?#iefix) format('embedded-opentype'), + url(\\"/webpack/public/path/font with spaces.eot?#iefix\\") format('embedded-opentype'); +} + +@media (min-width: 500px) { + body { + background: url(/webpack/public/path/img.png); + } +} + +a { + content: \\"do not use url(path)\\"; +} + +b { + content: 'do not \\"use\\" url(path)'; +} + +@keyframes O9YPhh3OZdzrkj25z-J92 { + background: green url(/webpack/public/path/img.png) xyz; +} + +._1fj5hnOVZ8KZVIGyZbPW3p { + background-image: -webkit-image-set(url(/webpack/public/path/img1x.png) 1x, url(/webpack/public/path/img2x.png) 2x) +} + +._1fj5hnOVZ8KZVIGyZbPW3p { + background-image: image-set(url(/webpack/public/path/img1x.png) 1x, url(/webpack/public/path/img2x.png) 2x) +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url() xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url('') xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(\\"\\") xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(' ') xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url( + + ) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz; +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png#hash); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png#hash); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background-image: url(/webpack/public/path/img.png) url(\\"data:image/svg+xml;charset=utf-8,\\") url(/webpack/public/path/img.png); +} + +._7NvzxsKlD5xT5cUVu5Ad- { + background: ___CSS_LOADER_URL___; + background: ___CSS_LOADER_URL___INDEX___; + background: ___CSS_LOADER_URL___99999___; + background: ___CSS_LOADER_IMPORT___; + background: ___CSS_LOADER_IMPORT___INDEX___; + background: ___CSS_LOADER_IMPORT___99999___; +} + +._2rb58RF5u2ij-3X8XSJaVP { + background: url(/webpack/public/path/img-simple.png); +} + +.mrf4tRz4T71pNku_3IMH3 { + background: url('/img-simple.png'); +} + +.c5dNFA35opKWoGz7aRj0k { + background: url(/webpack/public/path/img-simple.png); +} + +._2Q5a0g3xEHAboOADfIxHa5 { + background: url(/webpack/public/path/img.png); +} + +._2TX-7lb63hK5h5DzELIAbU { + background: url(/webpack/public/path/img.png); +} +", + "", + ], +] +`; + +exports[`url option true and modules \`true\`: module 1`] = ` +"var escape = require(\\"../../../lib/runtime/escape.js\\"); +exports = module.exports = require(\\"../../../lib/runtime/api.js\\")(false); +// imports +exports.i(require(\\"-!../../../index.js??ref--4-0!./imported.css\\"), \\"\\"); + +// module +exports.push([module.id, \\"._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"package/img.png\\")) + \\") url(\\" + escape(require(\\"./other-img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(/img.png) xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\\\\\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n filter: url('data:image/svg+xml;charset=utf-8,#filter');\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter');\\\\n}\\\\n\\\\n.lml_5t-nQdGlKc9OtKjUO {\\\\n filter: url(#highlight);\\\\n}\\\\n\\\\n.lml_5t-nQdGlKc9OtKjUO {\\\\n filter: url('#line-marker');\\\\n}\\\\n\\\\n@font-face {\\\\n src: url(\\" + escape(require(\\"./font.woff\\")) + \\") format('woff'),\\\\n url(\\" + escape(require(\\"./font.woff2\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\")) + \\") format('eot'),\\\\n url(\\" + escape(require(\\"package/font.ttf\\")) + \\") format('truetype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\")) + \\") format(\\\\\\"embedded-opentype\\\\\\"),\\\\n url(\\" + escape(require(\\"./font.svg\\") + \\"#svgFontName\\") + \\") format('svg'),\\\\n url(\\" + escape(require(\\"./font.woff2?foo=bar\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype');\\\\n}\\\\n\\\\n@media (min-width: 500px) {\\\\n body {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n }\\\\n}\\\\n\\\\na {\\\\n content: \\\\\\"do not use url(path)\\\\\\";\\\\n}\\\\n\\\\nb {\\\\n content: 'do not \\\\\\"use\\\\\\" url(path)';\\\\n}\\\\n\\\\n@keyframes O9YPhh3OZdzrkj25z-J92 {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n._1fj5hnOVZ8KZVIGyZbPW3p {\\\\n background-image: -webkit-image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n._1fj5hnOVZ8KZVIGyZbPW3p {\\\\n background-image: image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url() xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url('') xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\\\\\"\\\\\\") xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(' ') xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(\\\\n \\\\n ) xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png?foo\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: url(\\" + escape(require(\\"./img.png?\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background-image: url(\\" + escape(require(\\"./img.png\\")) + \\") url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\") url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n._7NvzxsKlD5xT5cUVu5Ad- {\\\\n background: ___CSS_LOADER_URL___;\\\\n background: ___CSS_LOADER_URL___INDEX___;\\\\n background: ___CSS_LOADER_URL___99999___;\\\\n background: ___CSS_LOADER_IMPORT___;\\\\n background: ___CSS_LOADER_IMPORT___INDEX___;\\\\n background: ___CSS_LOADER_IMPORT___99999___;\\\\n}\\\\n\\\\n._2rb58RF5u2ij-3X8XSJaVP {\\\\n background: url(\\" + escape(require(\\"./img-simple.png\\")) + \\");\\\\n}\\\\n\\\\n.mrf4tRz4T71pNku_3IMH3 {\\\\n background: url('/img-simple.png');\\\\n}\\\\n\\\\n.c5dNFA35opKWoGz7aRj0k {\\\\n background: url(\\" + escape(require(\\"../url/img-simple.png\\")) + \\");\\\\n}\\\\n\\\\n._2Q5a0g3xEHAboOADfIxHa5 {\\\\n background: url(\\" + escape(require(\\"package/img.png\\")) + \\");\\\\n}\\\\n\\\\n._2TX-7lb63hK5h5DzELIAbU {\\\\n background: url(\\" + escape(require(\\"aliasesImg/img.png\\")) + \\");\\\\n}\\\\n\\", \\"\\"]); + +// exports +exports.locals = { + \\"class\\": \\"_7NvzxsKlD5xT5cUVu5Ad-\\", + \\"highlight\\": \\"lml_5t-nQdGlKc9OtKjUO\\", + \\"a\\": \\"_1fj5hnOVZ8KZVIGyZbPW3p\\", + \\"pure-url\\": \\"_2rb58RF5u2ij-3X8XSJaVP\\", + \\"not-resolved\\": \\"mrf4tRz4T71pNku_3IMH3\\", + \\"above-below\\": \\"c5dNFA35opKWoGz7aRj0k\\", + \\"tilde\\": \\"_2Q5a0g3xEHAboOADfIxHa5\\", + \\"aliases\\": \\"_2TX-7lb63hK5h5DzELIAbU\\", + \\"anim\\": \\"O9YPhh3OZdzrkj25z-J92\\" +};" +`; + +exports[`url option true and modules \`true\`: warnings 1`] = ` +Array [ + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(120:3) Unable to find uri in 'background: green url() xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(124:3) Unable to find uri in 'background: green url('') xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(128:3) Unable to find uri in 'background: green url(\\"\\") xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(132:3) Unable to find uri in 'background: green url(' ') xyz'", + "ModuleWarning: Module Warning (from \`replaced original path\`): +Warning + +(136:3) Unable to find uri in 'background: green url( + ) xyz'", +] +`; + +exports[`url option true: errors 1`] = `Array []`; + +exports[`url option true: module (evaluated) 1`] = ` +Array [ + Array [ + 2, + ".bar { + background: url(/webpack/public/path/img-from-imported.png); +} +", + "", + ], + Array [ + 1, + ".class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: url(/webpack/public/path/img.png#hash); +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: green url(/webpack/public/path/img.png) xyz; +} + +.class { + background: green url(/webpack/public/path/img.png) xyz; +} + +.class { + background: green url(/webpack/public/path/img.png) xyz; +} + +.class { + background: green url(/webpack/public/path/img.png) url(/webpack/public/path/other-img.png) xyz; +} + +.class { + background: green url(\\"/webpack/public/path/img img.png\\") xyz; +} + +.class { + background: green url(\\"/webpack/public/path/img img.png\\") xyz; +} + +.class { + background: green url(/img.png) xyz; +} + +.class { + background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz; +} + +.class { + background-image: url(\\"data:image/svg+xml;charset=utf-8,\\"); +} + +.class { + background-image: url(\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\"); +} + +.class { + filter: url('data:image/svg+xml;charset=utf-8,#filter'); +} + +.class { + filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter'); +} + +.highlight { + filter: url(#highlight); +} + +.highlight { + filter: url('#line-marker'); +} + +@font-face { + src: url(/webpack/public/path/font.woff) format('woff'), + url(/webpack/public/path/font.woff2) format('woff2'), + url(/webpack/public/path/font.eot) format('eot'), + url(/webpack/public/path/font.ttf) format('truetype'), + url(\\"/webpack/public/path/font with spaces.eot\\") format(\\"embedded-opentype\\"), + url(/webpack/public/path/font.svg#svgFontName) format('svg'), + url(/webpack/public/path/font.woff2) format('woff2'), + url(/webpack/public/path/font.eot?#iefix) format('embedded-opentype'), + url(\\"/webpack/public/path/font with spaces.eot?#iefix\\") format('embedded-opentype'); +} + +@media (min-width: 500px) { + body { + background: url(/webpack/public/path/img.png); + } +} + +a { + content: \\"do not use url(path)\\"; +} + +b { + content: 'do not \\"use\\" url(path)'; +} + +@keyframes anim { + background: green url(/webpack/public/path/img.png) xyz; +} + +.a { + background-image: -webkit-image-set(url(/webpack/public/path/img1x.png) 1x, url(/webpack/public/path/img2x.png) 2x) +} + +.a { + background-image: image-set(url(/webpack/public/path/img1x.png) 1x, url(/webpack/public/path/img2x.png) 2x) +} + +.class { + background: green url() xyz; +} + +.class { + background: green url('') xyz; +} + +.class { + background: green url(\\"\\") xyz; +} + +.class { + background: green url(' ') xyz; +} + +.class { + background: green url( + + ) xyz; +} + +.class { + background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz; +} + +.class { + background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz; +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background: url(/webpack/public/path/img.png#hash); +} + +.class { + background: url(/webpack/public/path/img.png#hash); +} + +.class { + background: url(/webpack/public/path/img.png); +} + +.class { + background-image: url(/webpack/public/path/img.png) url(\\"data:image/svg+xml;charset=utf-8,\\") url(/webpack/public/path/img.png); +} + +.class { + background: ___CSS_LOADER_URL___; + background: ___CSS_LOADER_URL___INDEX___; + background: ___CSS_LOADER_URL___99999___; + background: ___CSS_LOADER_IMPORT___; + background: ___CSS_LOADER_IMPORT___INDEX___; + background: ___CSS_LOADER_IMPORT___99999___; +} + +.pure-url { + background: url(/webpack/public/path/img-simple.png); +} + +.not-resolved { + background: url('/img-simple.png'); +} + +.above-below { + background: url(/webpack/public/path/img-simple.png); +} + +.tilde { + background: url(/webpack/public/path/img.png); +} + +.aliases { + background: url(/webpack/public/path/img.png); +} ", "", ], @@ -415,7 +1495,7 @@ exports = module.exports = require(\\"../../../lib/runtime/api.js\\")(false); exports.i(require(\\"-!../../../index.js??ref--4-0!./imported.css\\"), \\"\\"); // module -exports.push([module.id, \\".class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./other-img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(/img.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,#filter');\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter');\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url(#highlight);\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url('#line-marker');\\\\n}\\\\n\\\\n@font-face {\\\\n src: url(\\" + escape(require(\\"./font.woff\\")) + \\") format('woff'),\\\\n url(\\" + escape(require(\\"./font.woff2\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\")) + \\") format('eot'),\\\\n \\\\n url(\\" + escape(require(\\"./font with spaces.eot\\")) + \\") format(\\\\\\"embedded-opentype\\\\\\"),\\\\n url(\\" + escape(require(\\"./font.svg\\") + \\"#svgFontName\\") + \\") format('svg'),\\\\n url(\\" + escape(require(\\"./font.woff2?foo=bar\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype');\\\\n}\\\\n\\\\n@media (min-width: 500px) {\\\\n body {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n }\\\\n}\\\\n\\\\na {\\\\n content: \\\\\\"do not use url(path)\\\\\\";\\\\n}\\\\n\\\\nb {\\\\n content: 'do not \\\\\\"use\\\\\\" url(path)';\\\\n}\\\\n\\\\n@keyframes anim {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.a {\\\\n background-image: -webkit-image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n.a {\\\\n background-image: image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n.class {\\\\n background: green url() xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url('') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\\\"\\\\\\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(' ') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\n \\\\n ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\" + escape(require(\\"./img.png\\")) + \\") url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\") url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: ___CSS_LOADER_URL___;\\\\n background: ___CSS_LOADER_URL___INDEX___;\\\\n background: ___CSS_LOADER_URL___99999___;\\\\n background: ___CSS_LOADER_IMPORT___;\\\\n background: ___CSS_LOADER_IMPORT___INDEX___;\\\\n background: ___CSS_LOADER_IMPORT___99999___;\\\\n}\\\\n\\", \\"\\"]); +exports.push([module.id, \\".class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"package/img.png\\")) + \\") url(\\" + escape(require(\\"./other-img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\" + escape(require(\\"./img img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(/img.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\\\\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E\\\\\\");\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,#filter');\\\\n}\\\\n\\\\n.class {\\\\n filter: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter');\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url(#highlight);\\\\n}\\\\n\\\\n.highlight {\\\\n filter: url('#line-marker');\\\\n}\\\\n\\\\n@font-face {\\\\n src: url(\\" + escape(require(\\"./font.woff\\")) + \\") format('woff'),\\\\n url(\\" + escape(require(\\"./font.woff2\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\")) + \\") format('eot'),\\\\n url(\\" + escape(require(\\"package/font.ttf\\")) + \\") format('truetype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\")) + \\") format(\\\\\\"embedded-opentype\\\\\\"),\\\\n url(\\" + escape(require(\\"./font.svg\\") + \\"#svgFontName\\") + \\") format('svg'),\\\\n url(\\" + escape(require(\\"./font.woff2?foo=bar\\")) + \\") format('woff2'),\\\\n url(\\" + escape(require(\\"./font.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype'),\\\\n url(\\" + escape(require(\\"./font with spaces.eot\\") + \\"?#iefix\\") + \\") format('embedded-opentype');\\\\n}\\\\n\\\\n@media (min-width: 500px) {\\\\n body {\\\\n background: url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n }\\\\n}\\\\n\\\\na {\\\\n content: \\\\\\"do not use url(path)\\\\\\";\\\\n}\\\\n\\\\nb {\\\\n content: 'do not \\\\\\"use\\\\\\" url(path)';\\\\n}\\\\n\\\\n@keyframes anim {\\\\n background: green url(\\" + escape(require(\\"./img.png\\")) + \\") xyz;\\\\n}\\\\n\\\\n.a {\\\\n background-image: -webkit-image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n.a {\\\\n background-image: image-set(url(\\" + escape(require(\\"./img1x.png\\")) + \\") 1x, url(\\" + escape(require(\\"./img2x.png\\")) + \\") 2x)\\\\n}\\\\n\\\\n.class {\\\\n background: green url() xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url('') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\\\"\\\\\\") xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(' ') xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(\\\\n \\\\n ) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(https://raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz;\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?foo=bar\\") + \\"#hash\\") + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: url(\\" + escape(require(\\"./img.png?\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background-image: url(\\" + escape(require(\\"./img.png\\")) + \\") url(\\\\\\"data:image/svg+xml;charset=utf-8,\\\\\\") url(\\" + escape(require(\\"./img.png\\")) + \\");\\\\n}\\\\n\\\\n.class {\\\\n background: ___CSS_LOADER_URL___;\\\\n background: ___CSS_LOADER_URL___INDEX___;\\\\n background: ___CSS_LOADER_URL___99999___;\\\\n background: ___CSS_LOADER_IMPORT___;\\\\n background: ___CSS_LOADER_IMPORT___INDEX___;\\\\n background: ___CSS_LOADER_IMPORT___99999___;\\\\n}\\\\n\\\\n.pure-url {\\\\n background: url(\\" + escape(require(\\"./img-simple.png\\")) + \\");\\\\n}\\\\n\\\\n.not-resolved {\\\\n background: url('/img-simple.png');\\\\n}\\\\n\\\\n.above-below {\\\\n background: url(\\" + escape(require(\\"../url/img-simple.png\\")) + \\");\\\\n}\\\\n\\\\n.tilde {\\\\n background: url(\\" + escape(require(\\"package/img.png\\")) + \\");\\\\n}\\\\n\\\\n.aliases {\\\\n background: url(\\" + escape(require(\\"aliasesImg/img.png\\")) + \\");\\\\n}\\\\n\\", \\"\\"]); // exports " diff --git a/test/fixtures/url/img-simple.png b/test/fixtures/url/img-simple.png new file mode 100644 index 00000000..b74b839e Binary files /dev/null and b/test/fixtures/url/img-simple.png differ diff --git a/test/fixtures/url/url.css b/test/fixtures/url/url.css index 0d05ad61..d23fa11b 100644 --- a/test/fixtures/url/url.css +++ b/test/fixtures/url/url.css @@ -35,7 +35,7 @@ } .class { - background: green /* url(~package/img.png) */ url(./other-img.png) xyz; + background: green url(~package/img.png) url(./other-img.png) xyz; } .class { @@ -82,7 +82,7 @@ src: url(./font.woff) format('woff'), url('./font.woff2') format('woff2'), url("./font.eot") format('eot'), - /*url(~package/font.ttf) format('truetype'), */ + url(~package/font.ttf) format('truetype'), url("./font with spaces.eot") format("embedded-opentype"), url('./font.svg#svgFontName') format('svg'), url('./font.woff2?foo=bar') format('woff2'), @@ -177,3 +177,23 @@ b { background: ___CSS_LOADER_IMPORT___INDEX___; background: ___CSS_LOADER_IMPORT___99999___; } + +.pure-url { + background: url('img-simple.png'); +} + +.not-resolved { + background: url('/img-simple.png'); +} + +.above-below { + background: url('../url/img-simple.png'); +} + +.tilde { + background: url('~package/img.png'); +} + +.aliases { + background: url('~aliasesImg/img.png') ; +} diff --git a/test/helpers.js b/test/helpers.js index be2f8596..c973d3e1 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -52,8 +52,13 @@ function evaluated(output, modules, moduleId = 1) { 'modules/tests-cases/composes-with-importing', 'modules/tests-cases/media-2', ].map((importedPath) => - path.resolve(__dirname, `./fixtures/${importedPath}`, module) + path.resolve( + __dirname, + `./fixtures/${importedPath}`, + module.replace('aliasesImg/', '') + ) ); + return importedPaths.includes(modulePath); }); @@ -165,6 +170,11 @@ function compile(fixture, config = {}, options = {}) { optimization: { runtimeChunk: true, }, + resolve: { + alias: { + aliasesImg: path.resolve(__dirname, 'fixtures/url'), + }, + }, }; // Compiler Options diff --git a/test/url-option.test.js b/test/url-option.test.js index 060c5f1f..0a556763 100644 --- a/test/url-option.test.js +++ b/test/url-option.test.js @@ -31,4 +31,27 @@ describe('url option', () => { expect(stats.compilation.warnings).toMatchSnapshot('warnings'); expect(stats.compilation.errors).toMatchSnapshot('errors'); }); + + [true, 'local', 'global', false].forEach((modulesValue) => { + it(`true and modules \`${modulesValue}\``, async () => { + const config = { + loader: { options: { modules: modulesValue } }, + }; + const testId = './url/url.css'; + const stats = await webpack(testId, config); + const { modules } = stats.toJson(); + const module = modules.find((m) => m.id === testId); + + expect(module.source).toMatchSnapshot('module'); + expect(evaluated(module.source, modules)).toMatchSnapshot( + 'module (evaluated)' + ); + expect(normalizeErrors(stats.compilation.warnings)).toMatchSnapshot( + 'warnings' + ); + expect(normalizeErrors(stats.compilation.errors)).toMatchSnapshot( + 'errors' + ); + }); + }); });