diff --git a/src/plugins/postcss-import-parser.js b/src/plugins/postcss-import-parser.js index 73048f20d..85318ca9f 100644 --- a/src/plugins/postcss-import-parser.js +++ b/src/plugins/postcss-import-parser.js @@ -112,15 +112,40 @@ function parseNode(atRule, key) { throw error; } - const mediaNodes = paramsNodes.slice(1); + const additionalNodes = paramsNodes.slice(1); + + let supports; + let layer; let media; - if (mediaNodes.length > 0) { - media = valueParser.stringify(mediaNodes).trim().toLowerCase(); + if (additionalNodes.length > 0) { + let nodes = []; + + for (const node of additionalNodes) { + nodes.push(node); + + if ( + (node.type === "function" && node.value.toLowerCase() === "layer") || + (node.type === "word" && node.value.toLowerCase() === "layer") + ) { + layer = valueParser.stringify(nodes).trim().toLowerCase(); + nodes = []; + } else if ( + node.type === "function" && + node.value.toLowerCase() === "supports" + ) { + supports = valueParser.stringify(nodes).trim().toLowerCase(); + nodes = []; + } + } + + if (nodes.length > 0) { + media = valueParser.stringify(nodes).trim().toLowerCase(); + } } // eslint-disable-next-line consistent-return - return { atRule, prefix, url, media, isRequestable }; + return { atRule, prefix, url, layer, supports, media, isRequestable }; } const plugin = (options = {}) => { @@ -154,11 +179,23 @@ const plugin = (options = {}) => { const resolvedAtRules = await Promise.all( parsedAtRules.map(async (parsedAtRule) => { - const { atRule, isRequestable, prefix, url, media } = - parsedAtRule; + const { + atRule, + isRequestable, + prefix, + url, + layer, + supports, + media, + } = parsedAtRule; if (options.filter) { - const needKeep = await options.filter(url, media); + const needKeep = await options.filter( + url, + media, + layer, + supports + ); if (!needKeep) { return; @@ -186,13 +223,20 @@ const plugin = (options = {}) => { atRule.remove(); // eslint-disable-next-line consistent-return - return { url: resolvedUrl, media, prefix, isRequestable }; + return { + url: resolvedUrl, + layer, + supports, + media, + prefix, + isRequestable, + }; } atRule.remove(); // eslint-disable-next-line consistent-return - return { url, media, prefix, isRequestable }; + return { url, layer, supports, media, prefix, isRequestable }; }) ); @@ -206,10 +250,11 @@ const plugin = (options = {}) => { continue; } - const { url, isRequestable, media } = resolvedAtRule; + const { url, isRequestable, layer, supports, media } = + resolvedAtRule; if (!isRequestable) { - options.api.push({ url, media, index }); + options.api.push({ url, layer, supports, media, index }); // eslint-disable-next-line no-continue continue; @@ -231,7 +276,7 @@ const plugin = (options = {}) => { }); } - options.api.push({ importName, media, index }); + options.api.push({ importName, layer, supports, media, index }); } }, }; diff --git a/src/runtime/api.js b/src/runtime/api.js index 1888424c4..5fa4caf62 100644 --- a/src/runtime/api.js +++ b/src/runtime/api.js @@ -10,10 +10,32 @@ module.exports = function (cssWithMappingToString) { // return the list of modules as css string list.toString = function toString() { return this.map((item) => { - const content = cssWithMappingToString(item); + let content = ""; + + if (item[4]) { + content += `@${item[4]} {`; + } + + if (item[3]) { + content += `@${item[3]} {`; + } + + if (item[2]) { + content += `@media ${item[2]} {`; + } + + content += cssWithMappingToString(item); if (item[2]) { - return `@media ${item[2]} {${content}}`; + content += "}"; + } + + if (item[3]) { + content += "}"; + } + + if (item[4]) { + content += "}"; } return content; @@ -22,7 +44,7 @@ module.exports = function (cssWithMappingToString) { // import a list of modules into the list // eslint-disable-next-line func-names - list.i = function (modules, mediaQuery, dedupe) { + list.i = function (modules, mediaQueryList, dedupe, layer, supports) { if (typeof modules === "string") { // eslint-disable-next-line no-param-reassign modules = [[null, modules, ""]]; @@ -49,11 +71,27 @@ module.exports = function (cssWithMappingToString) { continue; } - if (mediaQuery) { + if (mediaQueryList) { if (!item[2]) { - item[2] = mediaQuery; + item[2] = mediaQueryList; + } else { + item[2] = `${mediaQueryList} and ${item[2]}`; + } + } + + if (layer) { + if (!item[3]) { + item[3] = layer; + } else { + item[3] = `${layer} and ${item[3]}`; + } + } + + if (supports) { + if (!item[4]) { + item[4] = supports; } else { - item[2] = `${mediaQuery} and ${item[2]}`; + item[4] = `${supports} and ${item[4]}`; } } diff --git a/src/utils.js b/src/utils.js index 22a45fccc..2cb8bdf6e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -921,6 +921,32 @@ function normalizeSourceMapForRuntime(map, loaderContext) { return JSON.stringify(resultMap); } +function printParams(media, dedupe, supports, layer) { + let result = ""; + + if (layer) { + result = `, ${JSON.stringify(layer)}`; + } + + if (supports) { + result = `, ${JSON.stringify(supports)}${result}`; + } + + if (dedupe) { + result = `, true${result}`; + } else if (result.length > 0) { + result = `, false${result}`; + } + + if (media) { + result = `${JSON.stringify(media)}${result}`; + } else if (result.length > 0) { + result = `""${result}`; + } + + return result; +} + function getModuleCode(result, api, replacements, options, loaderContext) { if (options.modules.exportOnlyLocals === true) { return ""; @@ -939,15 +965,22 @@ function getModuleCode(result, api, replacements, options, loaderContext) { });\n`; for (const item of api) { - const { url, media, dedupe } = item; - - beforeCode += url - ? `___CSS_LOADER_EXPORT___.push([module.id, ${JSON.stringify( - `@import url(${url});` - )}${media ? `, ${JSON.stringify(media)}` : ""}]);\n` - : `___CSS_LOADER_EXPORT___.i(${item.importName}${ - media ? `, ${JSON.stringify(media)}` : dedupe ? ', ""' : "" - }${dedupe ? ", true" : ""});\n`; + const { url, layer, supports, media, dedupe } = item; + + if (url) { + // eslint-disable-next-line no-undefined + const printedParam = printParams(media, undefined, supports, layer); + + beforeCode += `___CSS_LOADER_EXPORT___.push([module.id, ${JSON.stringify( + `@import url(${url});` + )}${printedParam.length > 0 ? `, ${printedParam}` : ""}]);\n`; + } else { + const printedParam = printParams(media, dedupe, supports, layer); + + beforeCode += `___CSS_LOADER_EXPORT___.i(${item.importName}${ + printedParam.length > 0 ? `, ${printedParam}` : "" + });\n`; + } } for (const item of replacements) { diff --git a/test/__snapshots__/import-option.test.js.snap b/test/__snapshots__/import-option.test.js.snap index 033690a72..a8acdc499 100644 --- a/test/__snapshots__/import-option.test.js.snap +++ b/test/__snapshots__/import-option.test.js.snap @@ -1,466 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`"import" option should keep original order: errors 1`] = `Array []`; - -exports[`"import" option should keep original order: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./order-1.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_1___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./order-2.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_2___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./order-3.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_3___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./order-4.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___, \\"screen and (min-width: 2000px)\\"); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_2___); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_3___, \\"screen\\"); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"div {\\\\n width: 100%;\\\\n height: 200px;\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should keep original order: result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-1.css", - ".order-1 { - color: red; -} -", - "", - ], - Array [ - "./import/order.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-2.css", - ".order-2 { - color: red; -} -", - "", - ], - Array [ - "./import/order.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-1.css", - ".order-1 { - color: red; -} -", - "", - ], - Array [ - "./import/order.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-2.css", - ".order-2 { - color: red; -} -", - "screen and (min-width: 2000px)", - ], - Array [ - "./import/order.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-3-1.css", - ".order-3-1 { - color: white; -} -", - "screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-3.css", - ".order-3 { - color: red; -} -", - "", - ], - Array [ - "./import/order.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-4-1.css", - ".order-4-1 { - color: red; -} -", - "screen and (min-width: 1000px)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-4-2-1.css", - ".order-4-2-1 { - color: red; -} -", - "screen and (min-width: 2000px)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-4-2-2.css", - ".order-4-2-2 { - color: red; -} -", - "screen and (min-width: 2000px) and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-4-2.css", - ".order-4-2 { - color: red; -} -", - "screen and (min-width: 2000px)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/order-4.css", - ".order-4 { - color: red; -} -", - "screen", - ], - Array [ - "./import/order.css", - "div { - width: 100%; - height: 200px; -} -", - "", - ], -] -`; - -exports[`"import" option should keep original order: warnings 1`] = `Array []`; - -exports[`"import" option should resolve "file" protocol: errors 1`] = `Array []`; - -exports[`"import" option should resolve "file" protocol: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should resolve "file" protocol: result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "./import/import-file-protocol.css", - "", - "", - ], -] -`; - -exports[`"import" option should resolve "file" protocol: warnings 1`] = `Array []`; - -exports[`"import" option should resolve absolute path: errors 1`] = `Array []`; - -exports[`"import" option should resolve absolute path: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should resolve absolute path: result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "./import/import-absolute.css", - "", - "", - ], -] -`; - -exports[`"import" option should resolve absolute path: warnings 1`] = `Array []`; - -exports[`"import" option should resolve server-relative url relative rootContext: errors 1`] = `Array []`; - -exports[`"import" option should resolve server-relative url relative rootContext: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\".class {\\\\n a: b c d;\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should resolve server-relative url relative rootContext: result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "./import/import-server-relative-url.css", - ".class { - a: b c d; -} -", - "", - ], -] -`; - -exports[`"import" option should resolve server-relative url relative rootContext: warnings 1`] = `Array []`; - -exports[`"import" option should respect conditionNames: errors 1`] = `Array []`; - -exports[`"import" option should respect conditionNames: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./node_modules/package-with-exports/style.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should respect conditionNames: result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/package-with-exports/style.css", - ".load-me { - color: red; -} -", - "", - ], - Array [ - "./import/import-conditionNames.css", - " -", - "", - ], -] -`; - -exports[`"import" option should respect conditionNames: warnings 1`] = `Array []`; - -exports[`"import" option should respect style field in package.json: errors 1`] = `Array []`; - -exports[`"import" option should respect style field in package.json: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../../../src/runtime/api.js\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\".test {\\\\n color: coral;\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should respect style field in package.json: result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/issue-683-package/test.css", - ".test { - color: coral; -} -", - "", - ], - Array [ - "./import/issue-683.css", - " -", - "", - ], -] -`; - -exports[`"import" option should respect style field in package.json: warnings 1`] = `Array []`; - -exports[`"import" option should throw an error on unresolved import: errors 1`] = ` -Array [ - "ModuleBuildError: Module build failed (from \`replaced original path\`): -Error: Can't resolve 'unresolved-file.css' in '/test/fixtures/import'", -] -`; - -exports[`"import" option should throw an error on unresolved import: warnings 1`] = `Array []`; - -exports[`"import" option should work resolve order: local -> node_modules -> alias: errors 1`] = `Array []`; - -exports[`"import" option should work resolve order: local -> node_modules -> alias: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_1___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./issue-683.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_2___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./node_modules/package/tilde.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_2___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work resolve order: local -> node_modules -> alias: result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/issue-683-package/test.css", - ".test { - color: coral; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/issue-683.css", - " -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/package/tilde.css", - ".tilde { - color: yellow; -} -", - "", - ], - Array [ - "./import/import-order.css", - " -", - "", - ], -] -`; - -exports[`"import" option should work resolve order: local -> node_modules -> alias: warnings 1`] = `Array []`; - -exports[`"import" option should work when 'import.loaders' not specified: errors 1`] = `Array []`; - -exports[`"import" option should work when 'import.loaders' not specified: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js!./imported.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_1___ from \\"-!../../../src/index.js!./other-imported.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\".foo {\\\\n color: red;\\\\n color: rgba(0, 0, 255, 0.9);\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work when 'import.loaders' not specified: result 1`] = ` -Array [ - Array [ - "../../src/index.js!./nested-import/imported.css", - ".bar { - color: blue; - color: rgb(0 0 100% / 90%); -} -", - "", - ], - Array [ - "../../src/index.js!./nested-import/other-imported.css", - ".baz { - color: green; - color: rgb(0 0 100% / 90%); -} -", - "", - ], - Array [ - "./nested-import/source.css", - ".foo { - color: red; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], -] -`; - -exports[`"import" option should work when 'import.loaders' not specified: warnings 1`] = `Array []`; - exports[`"import" option should work when not specified: errors 1`] = `Array []`; exports[`"import" option should work when not specified: module 1`] = ` @@ -564,8 +103,8 @@ ___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_13___); ___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_14___); ___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_15___); ___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_16___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"supports(display: flex)\\"); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"supports(display: flex) screen and (orientation:landscape)\\"); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"\\", false, \\"supports(display: flex)\\"); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (orientation:landscape)\\", false, \\"supports(display: flex)\\"); ___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_17___); ___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_17___); ___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_18___); @@ -587,690 +126,284 @@ ___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_13___); ___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(data:text/css;charset=utf-8,a%20%7B%0D%0A%20%20color%3A%20red%3B%0D%0A%7D);\\"]); ___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_26___); ___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_27___); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"\\", false, \\"supports(display: flex)\\"); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (min-width: 400px)\\", false, \\"supports(display: flex)\\"); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"\\", false, \\"layer\\"); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"\\", false, \\"layer(default)\\"); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (min-width: 400px)\\", false, \\"supports(display: flex)\\", \\"layer(default)\\"); +___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css);\\", \\"screen and (min-width: 400px)\\", false, \\"supports(display: flex)\\"]); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (min-width:400px)\\", false, \\"supports(display: flex)\\", \\"layer(default)\\"); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (min-width: 400px)\\"); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and ( min-width : 400px )\\", false, \\"supports( display : flex )\\", \\"layer( default )\\"); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (min-width: 400px)\\", false, \\"supports(display: flex)\\", \\"layer(default)\\"); +___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (min-width: 400px)\\", false, \\"supports(display: flex)\\", \\"layer(default)\\"); var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___); // Module -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url();\\\\n@import url('');\\\\n@import url(\\\\\\"\\\\\\");\\\\n@import '';\\\\n@import \\\\\\"\\\\\\";\\\\n@import \\\\\\" \\\\\\";\\\\n@import \\\\\\"\\\\n\\\\\\";\\\\n@import url();\\\\n@import url('');\\\\n@import url(\\\\\\"\\\\\\");\\\\n@import ;\\\\n@import foo-bar;\\\\n@import-normalize;\\\\n@import url('http://') :root {}\\\\n\\\\n.class {\\\\n a: b c d;\\\\n}\\\\n\\\\n.foo {\\\\n @import 'path.css';\\\\n}\\\\n\\\\n.background {\\\\n background: url(\\" + ___CSS_LOADER_URL_REPLACEMENT_0___ + \\");\\\\n}\\\\n@import nourl(test.css);\\\\n@import '\\\\\\\\\\\\n\\\\\\\\\\\\n\\\\\\\\\\\\n';\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n@import url('!!../../helpers/string-loader.js?esModule=false!');\\\\n\\\\n/* Prefer relative */\\\\n\\", \\"\\"]); +___CSS_LOADER_EXPORT___.push([module.id, \\"@import url();\\\\n@import url('');\\\\n@import url(\\\\\\"\\\\\\");\\\\n@import '';\\\\n@import \\\\\\"\\\\\\";\\\\n@import \\\\\\" \\\\\\";\\\\n@import \\\\\\"\\\\n\\\\\\";\\\\n@import url();\\\\n@import url('');\\\\n@import url(\\\\\\"\\\\\\");\\\\n@import ;\\\\n@import foo-bar;\\\\n@import-normalize;\\\\n@import url('http://') :root {}\\\\n\\\\n.class {\\\\n a: b c d;\\\\n}\\\\n\\\\n.foo {\\\\n @import 'path.css';\\\\n}\\\\n\\\\n.background {\\\\n background: url(\\" + ___CSS_LOADER_URL_REPLACEMENT_0___ + \\");\\\\n}\\\\n@import nourl(test.css);\\\\n@import '\\\\\\\\\\\\n\\\\\\\\\\\\n\\\\\\\\\\\\n';\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n@import url('!!../../helpers/string-loader.js?esModule=false!');\\\\n\\\\n/* Prefer relative */\\\\n\\\\n/* TODO fix comments */\\\\n/* TODO check source maps generation */\\\\n\\", \\"\\"]); // Exports export default ___CSS_LOADER_EXPORT___; " `; exports[`"import" option should work when not specified: result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +".test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +@media screen and (orientation:landscape) {.test { a: a; } -", - "screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +}@media screen and (orientation: landscape) {.test { a: a; } -", - "screen and (orientation: landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +}@media screen and (orientation:landscape) {.test { a: a; } -", - "screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +}@media screen and (orientation:landscape) {.test { a: a; } -", - "screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test-nested-media.css", - "a { +}@media screen and (orientation:landscape) and (min-width: 100px) {a { b: b; } -", - "screen and (orientation:landscape) and (min-width: 100px)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test-media.css", - ".test { +}@media screen and (orientation:landscape) {.test { c: c; } -", - "screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test-other.css", - ".test { +}@media (min-width: 100px) {.test { d: d; } -", - "(min-width: 100px)", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css#hash);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css?#hash);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css?foo=bar#hash);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/other-style.css);", - "screen and (orientation:landscape)", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/other-style.css);", - "screen and (orientation:landscape)", - ], - Array [ - "./import/import.css", - "@import url(//example.com/style.css);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/package/test.css", - ".test { +}@import url(http://example.com/style.css);@import url(http://example.com/style.css);@import url(http://example.com/style.css#hash);@import url(http://example.com/style.css?#hash);@import url(http://example.com/style.css?foo=bar#hash);@media screen and (orientation:landscape) {@import url(http://example.com/other-style.css);}@media screen and (orientation:landscape) {@import url(http://example.com/other-style.css);}@import url(//example.com/style.css);.test { d: d } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/query.css?foo=1&bar=1", - ".query { +.query { e: e; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/other-query.css?foo=1&bar=1#hash", - ".other-query { +.other-query { f: f; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/other-query.css?foo=1&bar=1#hash", - ".other-query { +@media screen and (orientation:landscape) {.other-query { f: f; } -", - "screen and (orientation:landscape)", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Roboto);", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC);", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC|Roboto);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/relative.css", - ".relative { +}@import url(https://fonts.googleapis.com/css?family=Roboto);@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC);@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC|Roboto);.relative { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/top-relative.css", - ".top-relative { +.top-relative { color: black; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/package/tilde.css", - ".tilde { +.tilde { color: yellow; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/alias.css", - ".alias { +.alias { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/url.css", - ".background-imported { +.background-imported { background: url(replaced_file_protocol_/webpack/public/path/img.png); } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { +.strange { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { +.strange { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { +.strange { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { +.strange { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { +.space { color: gray; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../helpers/string-loader.js?esModule=false!./import/node_modules/package/tilde.css", - "a { color: red };", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css?foo=bar", - ".test { +a { color: red };.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css?foo=bar#hash", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css?#hash", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +@supports(display: flex) {.test { a: a; } -", - "supports(display: flex)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +}@supports(display: flex) {@media screen and (orientation:landscape) {.test { a: a; } -", - "supports(display: flex) screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css", - ".my-box { +}}.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#hash", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#hash", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?bar=foo", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#one", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#two", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=1&bar=2", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=2&bar=1", - ".my-box { +.my-box { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { +.test { a: a; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/my.scss", - "a { +a { color: red; -}", - "", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Roboto);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../helpers/string-loader.js?esModule=false!./import/node_modules/package/tilde.css", - "a { color: red };", - "", - ], - Array [ - "./import/import.css", - "@import url(data:text/css;charset=utf-8,a%20%7B%0D%0A%20%20color%3A%20red%3B%0D%0A%7D);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/package/first.css", - ".first { +}@import url(https://fonts.googleapis.com/css?family=Roboto);a { color: red };@import url(data:text/css;charset=utf-8,a%20%7B%0D%0A%20%20color%3A%20red%3B%0D%0A%7D);.first { color: red; } -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/package/second.css", - ".second { +.second { color: red; } -", - "", - ], - Array [ - "./import/import.css", - "@import url(); +@supports(display: flex) {.test { + a: a; +} +}@supports(display: flex) {@media screen and (min-width: 400px) {.test { + a: a; +} +}}@layer {.test { + a: a; +} +}@layer(default) {.test { + a: a; +} +}@layer(default) {@supports(display: flex) {@media screen and (min-width: 400px) {.test { + a: a; +} +}}}@supports(display: flex) {@media screen and (min-width: 400px) {@import url(http://example.com/style.css);}}@layer(default) {@supports(display: flex) {@media screen and (min-width:400px) {.test { + a: a; +} +}}}@media screen and (min-width: 400px) {.test { + a: a; +} +}@layer( default ) {@supports( display : flex ) {@media screen and ( min-width : 400px ) {.test { + a: a; +} +}}}@layer(default) {@supports(display: flex) {@media screen and (min-width: 400px) {.test { + a: a; +} +}}}@layer(default) {@supports(display: flex) {@media screen and (min-width: 400px) {.test { + a: a; +} +}}}@import url(); @import url(''); @import url(\\"\\"); @import ''; @@ -1317,10 +450,10 @@ Array [ @import url('!!../../helpers/string-loader.js?esModule=false!'); /* Prefer relative */ -", - "", - ], -] + +/* TODO fix comments */ +/* TODO check source maps generation */ +" `; exports[`"import" option should work when not specified: warnings 1`] = ` @@ -1395,2092 +528,3 @@ Warning (43:1) It looks like you didn't end your @import statement correctly. Child nodes are attached to it.", ] `; - -exports[`"import" option should work with 'false' aliases: errors 1`] = `Array []`; - -exports[`"import" option should work with 'false' aliases: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"@import \\\\\\"/style.css\\\\\\";\\\\n\\\\n.class {\\\\n color: red;\\\\n}\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with 'false' aliases: result 1`] = ` -Array [ - Array [ - "./import/false-alias.css", - "@import \\"/style.css\\"; - -.class { - color: red; -}", - "", - ], -] -`; - -exports[`"import" option should work with 'false' aliases: warnings 1`] = `Array []`; - -exports[`"import" option should work with 'resolve.byDependency.css.extensions': errors 1`] = `Array []`; - -exports[`"import" option should work with 'resolve.byDependency.css.extensions': module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./extensions-imported.mycss\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"a {\\\\n color: red;\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with 'resolve.byDependency.css.extensions': result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/extensions-imported.mycss", - "div { - color: red; -} -", - "", - ], - Array [ - "./import/extensions.css", - "a { - color: red; -} -", - "", - ], -] -`; - -exports[`"import" option should work with 'resolve.byDependency.css.extensions': warnings 1`] = `Array []`; - -exports[`"import" option should work with 'resolve.extensions': errors 1`] = `Array []`; - -exports[`"import" option should work with 'resolve.extensions': module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./extensions-imported.mycss\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"a {\\\\n color: red;\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with 'resolve.extensions': result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/extensions-imported.mycss", - "div { - color: red; -} -", - "", - ], - Array [ - "./import/extensions.css", - "a { - color: red; -} -", - "", - ], -] -`; - -exports[`"import" option should work with 'resolve.extensions': warnings 1`] = `Array []`; - -exports[`"import" option should work with a "import.loaders" value equal to ""1"" ("postcss-loader" before): errors 1`] = `Array []`; - -exports[`"import" option should work with a "import.loaders" value equal to ""1"" ("postcss-loader" before): module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./imported.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_1___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./other-imported.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\".foo {\\\\n color: red;\\\\n color: rgba(0, 0, 255, 0.9);\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with a "import.loaders" value equal to ""1"" ("postcss-loader" before): result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./nested-import/imported.css", - ".bar { - color: blue; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./nested-import/other-imported.css", - ".baz { - color: green; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], - Array [ - "./nested-import/source.css", - ".foo { - color: red; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], -] -`; - -exports[`"import" option should work with a "import.loaders" value equal to ""1"" ("postcss-loader" before): warnings 1`] = `Array []`; - -exports[`"import" option should work with a "import.loaders" value equal to "0" (\`postcss-loader\` before): errors 1`] = `Array []`; - -exports[`"import" option should work with a "import.loaders" value equal to "0" (\`postcss-loader\` before): module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./imported.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_1___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./other-imported.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\".foo {\\\\n color: red;\\\\n color: rgba(0, 0, 255, 0.9);\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with a "import.loaders" value equal to "0" (\`postcss-loader\` before): result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./nested-import/imported.css", - ".bar { - color: blue; - color: rgb(0 0 100% / 90%); -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./nested-import/other-imported.css", - ".baz { - color: green; - color: rgb(0 0 100% / 90%); -} -", - "", - ], - Array [ - "./nested-import/source.css", - ".foo { - color: red; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], -] -`; - -exports[`"import" option should work with a "import.loaders" value equal to "0" (\`postcss-loader\` before): warnings 1`] = `Array []`; - -exports[`"import" option should work with a "import.loaders" value equal to "1" ("postcss-loader" before): errors 1`] = `Array []`; - -exports[`"import" option should work with a "import.loaders" value equal to "1" ("postcss-loader" before): module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./imported.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_1___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./other-imported.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\".foo {\\\\n color: red;\\\\n color: rgba(0, 0, 255, 0.9);\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with a "import.loaders" value equal to "1" ("postcss-loader" before): result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./nested-import/imported.css", - ".bar { - color: blue; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./nested-import/other-imported.css", - ".baz { - color: green; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], - Array [ - "./nested-import/source.css", - ".foo { - color: red; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], -] -`; - -exports[`"import" option should work with a "import.loaders" value equal to "1" ("postcss-loader" before): warnings 1`] = `Array []`; - -exports[`"import" option should work with a "import.loaders" value equal to "1" (no loaders before): errors 1`] = `Array []`; - -exports[`"import" option should work with a "import.loaders" value equal to "1" (no loaders before): module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./imported.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_1___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./other-imported.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\".foo {\\\\n color: red;\\\\n color: rgb(0 0 100% / 90%);\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with a "import.loaders" value equal to "1" (no loaders before): result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./nested-import/imported.css", - ".bar { - color: blue; - color: rgb(0 0 100% / 90%); -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./nested-import/other-imported.css", - ".baz { - color: green; - color: rgb(0 0 100% / 90%); -} -", - "", - ], - Array [ - "./nested-import/source.css", - ".foo { - color: red; - color: rgb(0 0 100% / 90%); -} -", - "", - ], -] -`; - -exports[`"import" option should work with a "import.loaders" value equal to "1" (no loaders before): warnings 1`] = `Array []`; - -exports[`"import" option should work with a "import.loaders" value equal to "2" ("postcss-loader" before): errors 1`] = `Array []`; - -exports[`"import" option should work with a "import.loaders" value equal to "2" ("postcss-loader" before): module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./imported.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_1___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./other-imported.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\".foo {\\\\n color: red;\\\\n color: rgba(0, 0, 255, 0.9);\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with a "import.loaders" value equal to "2" ("postcss-loader" before): result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./nested-import/imported.css", - ".bar { - color: blue; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./nested-import/other-imported.css", - ".baz { - color: green; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], - Array [ - "./nested-import/source.css", - ".foo { - color: red; - color: rgba(0, 0, 255, 0.9); -} -", - "", - ], -] -`; - -exports[`"import" option should work with a "import.loaders" value equal to "2" ("postcss-loader" before): warnings 1`] = `Array []`; - -exports[`"import" option should work with a value equal to "false": errors 1`] = `Array []`; - -exports[`"import" option should work with a value equal to "false": module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_GET_URL_IMPORT___ from \\"../../../src/runtime/getUrl.js\\"; -var ___CSS_LOADER_URL_IMPORT_0___ = new URL(\\"./img.png\\", import.meta.url); -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(test.css);\\\\n@import url('test.css');\\\\n@import url(\\\\\\"test.css\\\\\\");\\\\n@IMPORT url(test.css);\\\\n@import URL(test.css);\\\\n@import url(test.css );\\\\n@import url( test.css);\\\\n@import url( test.css );\\\\n@import url(\\\\n test.css\\\\n);\\\\n@import url();\\\\n@import url('');\\\\n@import url(\\\\\\"\\\\\\");\\\\n@import \\\\\\"test.css\\\\\\";\\\\n@import 'test.css';\\\\n@import '';\\\\n@import \\\\\\"\\\\\\";\\\\n@import \\\\\\" \\\\\\";\\\\n@import \\\\\\"\\\\n\\\\\\";\\\\n@import url();\\\\n@import url('');\\\\n@import url(\\\\\\"\\\\\\");\\\\n@import url(test.css) screen and (orientation:landscape);\\\\n@import url(test.css) SCREEN AND (ORIENTATION: LANDSCAPE);\\\\n@import url(test.css)screen and (orientation:landscape);\\\\n@import url(test.css) screen and (orientation:landscape);\\\\n@import url(test-media.css) screen and (orientation:landscape);\\\\n@import url(test-other.css) (min-width: 100px);\\\\n@import url(http://example.com/style.css);\\\\n@import url(http://example.com/style.css);\\\\n@import url(http://example.com/style.css#hash);\\\\n@import url(http://example.com/style.css?#hash);\\\\n@import url(http://example.com/style.css?foo=bar#hash);\\\\n@import url(http://example.com/other-style.css) screen and (orientation:landscape);\\\\n@import url(http://example.com/other-style.css) screen and (orientation:landscape);\\\\n@import url(\\\\\\"//example.com/style.css\\\\\\");\\\\n@import url(~package/test.css);\\\\n@import ;\\\\n@import foo-bar;\\\\n@import-normalize;\\\\n@import url('http://') :root {}\\\\n@import url('query.css?foo=1&bar=1');\\\\n@import url('other-query.css?foo=1&bar=1#hash');\\\\n@import url('other-query.css?foo=1&bar=1#hash') screen and (orientation:landscape);\\\\n@import url('https://fonts.googleapis.com/css?family=Roboto');\\\\n@import url('https://fonts.googleapis.com/css?family=Noto+Sans+TC');\\\\n@import url('https://fonts.googleapis.com/css?family=Noto+Sans+TC|Roboto');\\\\n\\\\n.class {\\\\n a: b c d;\\\\n}\\\\n\\\\n.foo {\\\\n @import 'path.css';\\\\n}\\\\n\\\\n@import url('./relative.css');\\\\n@import url('../import/top-relative.css');\\\\n@import url(~package/tilde.css);\\\\n@import url(~aliasesImport/alias.css);\\\\n@import url('./url.css');\\\\n\\\\n.background {\\\\n background: url(\\" + ___CSS_LOADER_URL_REPLACEMENT_0___ + \\");\\\\n}\\\\n\\\\n@import url(./test.css);\\\\n\\\\n@import './te\\\\\\\\\\\\nst.css';\\\\n@import './te\\\\\\\\\\\\n\\\\\\\\\\\\n\\\\\\\\\\\\nst.css';\\\\n@import url('./te\\\\\\\\\\\\nst.css');\\\\n@import url('./te\\\\\\\\\\\\n\\\\\\\\\\\\n\\\\\\\\\\\\nst.css');\\\\n\\\\n@import \\\\\\"./te'st.css\\\\\\";\\\\n@import url(\\\\\\"./te'st.css\\\\\\");\\\\n@import './te\\\\\\\\'st.css';\\\\n@import url('./te\\\\\\\\'st.css');\\\\n@import './test test.css';\\\\n@import url('./test test.css');\\\\n@import './test\\\\\\\\ test.css';\\\\n@import url('./test\\\\\\\\ test.css');\\\\n@import './test%20test.css';\\\\n@import url('./test%20test.css');\\\\n@import './\\\\\\\\74\\\\\\\\65\\\\\\\\73\\\\\\\\74.css';\\\\n@import url('./\\\\\\\\74\\\\\\\\65\\\\\\\\73\\\\\\\\74.css');\\\\n@import './t\\\\\\\\65\\\\\\\\73\\\\\\\\74.css';\\\\n@import url('./t\\\\\\\\65\\\\\\\\73\\\\\\\\74.css');\\\\n@import url(./test\\\\\\\\ test.css);\\\\n@import url(./t\\\\\\\\65st%20test.css);\\\\n@import url('./t\\\\\\\\65st%20test.css');\\\\n@import url(\\\\\\"./t\\\\\\\\65st%20test.css\\\\\\");\\\\n@import \\\\\\"./t\\\\\\\\65st%20test.css\\\\\\";\\\\n@import './t\\\\\\\\65st%20test.css';\\\\n@import url( test.css );\\\\n@import nourl(test.css);\\\\n@import '\\\\\\\\\\\\n\\\\\\\\\\\\n\\\\\\\\\\\\n';\\\\n@import url('!!../../helpers/string-loader.js?esModule=false!~package/tilde.css');\\\\n@import url(test.css?foo=bar);\\\\n@import url(test.css?foo=bar#hash);\\\\n@import url(test.css?#hash);\\\\n@import \\\\\\"test.css\\\\\\" supports(display: flex);\\\\n@import \\\\\\"test.css\\\\\\" supports(display: flex) screen and (orientation:landscape);\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n@import url('something.css');\\\\n@import url('something.css');\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n@import url('something.css?foo=bar');\\\\n@import url('something.css?foo=bar');\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n@import url('something.css?foo=bar#hash');\\\\n@import url('something.css?foo=bar#hash');\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n@import url('something.css?foo=bar');\\\\n@import url('something.css?bar=foo');\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n@import url('something.css?foo=bar#one');\\\\n@import url('something.css?foo=bar#two');\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n@import url('something.css?foo=1&bar=2');\\\\n@import url('something.css?foo=2&bar=1');\\\\n\\\\n@import \\\\\\" ./test.css \\\\\\";\\\\n@import url(' ./test.css ');\\\\n@import url( ./test.css );\\\\n\\\\n@import \\\\\\"./my.scss\\\\\\";\\\\n\\\\n@import url(' https://fonts.googleapis.com/css?family=Roboto ');\\\\n@import url('!!../../helpers/string-loader.js?esModule=false!');\\\\n@import url(' !!../../helpers/string-loader.js?esModule=false!~package/tilde.css ');\\\\n@import url(data:text/css;charset=utf-8,a%20%7B%0D%0A%20%20color%3A%20red%3B%0D%0A%7D);\\\\n\\\\n/* Prefer relative */\\\\n@import url(package/first.css);\\\\n@import url(package/second.css);\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with a value equal to "false": result 1`] = ` -Array [ - Array [ - "./import/import.css", - "@import url(test.css); -@import url('test.css'); -@import url(\\"test.css\\"); -@IMPORT url(test.css); -@import URL(test.css); -@import url(test.css ); -@import url( test.css); -@import url( test.css ); -@import url( - test.css -); -@import url(); -@import url(''); -@import url(\\"\\"); -@import \\"test.css\\"; -@import 'test.css'; -@import ''; -@import \\"\\"; -@import \\" \\"; -@import \\" -\\"; -@import url(); -@import url(''); -@import url(\\"\\"); -@import url(test.css) screen and (orientation:landscape); -@import url(test.css) SCREEN AND (ORIENTATION: LANDSCAPE); -@import url(test.css)screen and (orientation:landscape); -@import url(test.css) screen and (orientation:landscape); -@import url(test-media.css) screen and (orientation:landscape); -@import url(test-other.css) (min-width: 100px); -@import url(http://example.com/style.css); -@import url(http://example.com/style.css); -@import url(http://example.com/style.css#hash); -@import url(http://example.com/style.css?#hash); -@import url(http://example.com/style.css?foo=bar#hash); -@import url(http://example.com/other-style.css) screen and (orientation:landscape); -@import url(http://example.com/other-style.css) screen and (orientation:landscape); -@import url(\\"//example.com/style.css\\"); -@import url(~package/test.css); -@import ; -@import foo-bar; -@import-normalize; -@import url('http://') :root {} -@import url('query.css?foo=1&bar=1'); -@import url('other-query.css?foo=1&bar=1#hash'); -@import url('other-query.css?foo=1&bar=1#hash') screen and (orientation:landscape); -@import url('https://fonts.googleapis.com/css?family=Roboto'); -@import url('https://fonts.googleapis.com/css?family=Noto+Sans+TC'); -@import url('https://fonts.googleapis.com/css?family=Noto+Sans+TC|Roboto'); - -.class { - a: b c d; -} - -.foo { - @import 'path.css'; -} - -@import url('./relative.css'); -@import url('../import/top-relative.css'); -@import url(~package/tilde.css); -@import url(~aliasesImport/alias.css); -@import url('./url.css'); - -.background { - background: url(replaced_file_protocol_/webpack/public/path/img.png); -} - -@import url(./test.css); - -@import './te\\\\ -st.css'; -@import './te\\\\ -\\\\ -\\\\ -st.css'; -@import url('./te\\\\ -st.css'); -@import url('./te\\\\ -\\\\ -\\\\ -st.css'); - -@import \\"./te'st.css\\"; -@import url(\\"./te'st.css\\"); -@import './te\\\\'st.css'; -@import url('./te\\\\'st.css'); -@import './test test.css'; -@import url('./test test.css'); -@import './test\\\\ test.css'; -@import url('./test\\\\ test.css'); -@import './test%20test.css'; -@import url('./test%20test.css'); -@import './\\\\74\\\\65\\\\73\\\\74.css'; -@import url('./\\\\74\\\\65\\\\73\\\\74.css'); -@import './t\\\\65\\\\73\\\\74.css'; -@import url('./t\\\\65\\\\73\\\\74.css'); -@import url(./test\\\\ test.css); -@import url(./t\\\\65st%20test.css); -@import url('./t\\\\65st%20test.css'); -@import url(\\"./t\\\\65st%20test.css\\"); -@import \\"./t\\\\65st%20test.css\\"; -@import './t\\\\65st%20test.css'; -@import url( test.css ); -@import nourl(test.css); -@import '\\\\ -\\\\ -\\\\ -'; -@import url('!!../../helpers/string-loader.js?esModule=false!~package/tilde.css'); -@import url(test.css?foo=bar); -@import url(test.css?foo=bar#hash); -@import url(test.css?#hash); -@import \\"test.css\\" supports(display: flex); -@import \\"test.css\\" supports(display: flex) screen and (orientation:landscape); - -/* Should be one import and two css modules */ - -@import url('something.css'); -@import url('something.css'); - -/* Should be one import and two css modules */ - -@import url('something.css?foo=bar'); -@import url('something.css?foo=bar'); - -/* Should be one import and two css modules */ - -@import url('something.css?foo=bar#hash'); -@import url('something.css?foo=bar#hash'); - -/* Should be two import and two css modules */ - -@import url('something.css?foo=bar'); -@import url('something.css?bar=foo'); - -/* Should be two import and two css modules */ - -@import url('something.css?foo=bar#one'); -@import url('something.css?foo=bar#two'); - -/* Should be two import and two css modules */ - -@import url('something.css?foo=1&bar=2'); -@import url('something.css?foo=2&bar=1'); - -@import \\" ./test.css \\"; -@import url(' ./test.css '); -@import url( ./test.css ); - -@import \\"./my.scss\\"; - -@import url(' https://fonts.googleapis.com/css?family=Roboto '); -@import url('!!../../helpers/string-loader.js?esModule=false!'); -@import url(' !!../../helpers/string-loader.js?esModule=false!~package/tilde.css '); -@import url(data:text/css;charset=utf-8,a%20%7B%0D%0A%20%20color%3A%20red%3B%0D%0A%7D); - -/* Prefer relative */ -@import url(package/first.css); -@import url(package/second.css); -", - "", - ], -] -`; - -exports[`"import" option should work with a value equal to "false": warnings 1`] = `Array []`; - -exports[`"import" option should work with a value equal to "true": errors 1`] = `Array []`; - -exports[`"import" option should work with a value equal to "true": module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_1___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test-media.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_2___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test-other.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_3___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./node_modules/package/test.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_4___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./query.css?foo=1&bar=1\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_5___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./other-query.css?foo=1&bar=1#hash\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_6___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./relative.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_7___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./top-relative.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_8___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./node_modules/package/tilde.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_9___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./alias.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_10___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./url.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_11___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./te'st.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_12___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test test.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_13___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!!!../../helpers/string-loader.js?esModule=false!./node_modules/package/tilde.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_14___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test.css?foo=bar\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_15___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test.css?foo=bar#hash\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_16___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test.css?#hash\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_17___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_18___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=bar\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_19___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=bar#hash\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_20___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?bar=foo\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_21___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=bar#one\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_22___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=bar#two\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_23___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=1&bar=2\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_24___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=2&bar=1\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_25___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./my.scss\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_26___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./package/first.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_27___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./node_modules/package/second.css\\"; -import ___CSS_LOADER_GET_URL_IMPORT___ from \\"../../../src/runtime/getUrl.js\\"; -var ___CSS_LOADER_URL_IMPORT_0___ = new URL(\\"./img.png\\", import.meta.url); -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (orientation:landscape)\\"); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (orientation: landscape)\\"); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (orientation:landscape)\\"); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (orientation:landscape)\\"); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___, \\"screen and (orientation:landscape)\\"); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_2___, \\"(min-width: 100px)\\"); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css#hash);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css?#hash);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css?foo=bar#hash);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/other-style.css);\\", \\"screen and (orientation:landscape)\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/other-style.css);\\", \\"screen and (orientation:landscape)\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(//example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_3___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_4___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_5___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_5___, \\"screen and (orientation:landscape)\\"); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(https://fonts.googleapis.com/css?family=Roboto);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC|Roboto);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_6___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_7___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_8___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_9___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_10___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_11___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_11___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_11___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_11___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_13___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_14___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_15___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_16___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"supports(display: flex)\\"); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"supports(display: flex) screen and (orientation:landscape)\\"); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_17___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_17___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_18___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_18___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_19___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_19___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_18___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_20___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_21___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_22___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_23___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_24___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_25___); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(https://fonts.googleapis.com/css?family=Roboto);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_13___); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(data:text/css;charset=utf-8,a%20%7B%0D%0A%20%20color%3A%20red%3B%0D%0A%7D);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_26___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_27___); -var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url();\\\\n@import url('');\\\\n@import url(\\\\\\"\\\\\\");\\\\n@import '';\\\\n@import \\\\\\"\\\\\\";\\\\n@import \\\\\\" \\\\\\";\\\\n@import \\\\\\"\\\\n\\\\\\";\\\\n@import url();\\\\n@import url('');\\\\n@import url(\\\\\\"\\\\\\");\\\\n@import ;\\\\n@import foo-bar;\\\\n@import-normalize;\\\\n@import url('http://') :root {}\\\\n\\\\n.class {\\\\n a: b c d;\\\\n}\\\\n\\\\n.foo {\\\\n @import 'path.css';\\\\n}\\\\n\\\\n.background {\\\\n background: url(\\" + ___CSS_LOADER_URL_REPLACEMENT_0___ + \\");\\\\n}\\\\n@import nourl(test.css);\\\\n@import '\\\\\\\\\\\\n\\\\\\\\\\\\n\\\\\\\\\\\\n';\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n@import url('!!../../helpers/string-loader.js?esModule=false!');\\\\n\\\\n/* Prefer relative */\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with a value equal to "true": result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "screen and (orientation: landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test-nested-media.css", - "a { - b: b; -} -", - "screen and (orientation:landscape) and (min-width: 100px)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test-media.css", - ".test { - c: c; -} -", - "screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test-other.css", - ".test { - d: d; -} -", - "(min-width: 100px)", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css#hash);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css?#hash);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css?foo=bar#hash);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/other-style.css);", - "screen and (orientation:landscape)", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/other-style.css);", - "screen and (orientation:landscape)", - ], - Array [ - "./import/import.css", - "@import url(//example.com/style.css);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/package/test.css", - ".test { - d: d -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/query.css?foo=1&bar=1", - ".query { - e: e; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/other-query.css?foo=1&bar=1#hash", - ".other-query { - f: f; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/other-query.css?foo=1&bar=1#hash", - ".other-query { - f: f; -} -", - "screen and (orientation:landscape)", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Roboto);", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC);", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC|Roboto);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/relative.css", - ".relative { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/top-relative.css", - ".top-relative { - color: black; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/package/tilde.css", - ".tilde { - color: yellow; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/alias.css", - ".alias { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/url.css", - ".background-imported { - background: url(replaced_file_protocol_/webpack/public/path/img.png); -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test test.css", - ".space { - color: gray; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../helpers/string-loader.js?esModule=false!./import/node_modules/package/tilde.css", - "a { color: red };", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css?foo=bar", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css?foo=bar#hash", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css?#hash", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "supports(display: flex)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "supports(display: flex) screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#hash", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#hash", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?bar=foo", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#one", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#two", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=1&bar=2", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=2&bar=1", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test.css", - ".test { - a: a; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/my.scss", - "a { - color: red; -}", - "", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Roboto);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../helpers/string-loader.js?esModule=false!./import/node_modules/package/tilde.css", - "a { color: red };", - "", - ], - Array [ - "./import/import.css", - "@import url(data:text/css;charset=utf-8,a%20%7B%0D%0A%20%20color%3A%20red%3B%0D%0A%7D);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/package/first.css", - ".first { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/package/second.css", - ".second { - color: red; -} -", - "", - ], - Array [ - "./import/import.css", - "@import url(); -@import url(''); -@import url(\\"\\"); -@import ''; -@import \\"\\"; -@import \\" \\"; -@import \\" -\\"; -@import url(); -@import url(''); -@import url(\\"\\"); -@import ; -@import foo-bar; -@import-normalize; -@import url('http://') :root {} - -.class { - a: b c d; -} - -.foo { - @import 'path.css'; -} - -.background { - background: url(replaced_file_protocol_/webpack/public/path/img.png); -} -@import nourl(test.css); -@import '\\\\ -\\\\ -\\\\ -'; - -/* Should be one import and two css modules */ - -/* Should be one import and two css modules */ - -/* Should be one import and two css modules */ - -/* Should be two import and two css modules */ - -/* Should be two import and two css modules */ - -/* Should be two import and two css modules */ -@import url('!!../../helpers/string-loader.js?esModule=false!'); - -/* Prefer relative */ -", - "", - ], -] -`; - -exports[`"import" option should work with a value equal to "true": warnings 1`] = ` -Array [ - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(105:1) Unable to find uri in \\"@import nourl(test.css)\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(106:1) Unable to find uri in \\"@import '\\\\ -\\\\ -\\\\ -'\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(12:1) Unable to find uri in \\"@import url()\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(13:1) Unable to find uri in \\"@import url('')\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(14:1) Unable to find uri in \\"@import url(\\"\\")\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(154:1) Unable to find uri in \\"@import url('!!../../helpers/string-loader.js?esModule=false!')\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(17:1) Unable to find uri in \\"@import ''\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(18:1) Unable to find uri in \\"@import \\"\\"\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(19:1) Unable to find uri in \\"@import \\" \\"\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(20:1) Unable to find uri in \\"@import \\" -\\"\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(22:1) Unable to find uri in \\"@import url()\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(23:1) Unable to find uri in \\"@import url('')\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(24:1) Unable to find uri in \\"@import url(\\"\\")\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(40:1) Unable to find uri in \\"@import \\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(41:1) Unable to find uri in \\"@import foo-bar\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(43:1) It looks like you didn't end your @import statement correctly. Child nodes are attached to it.", -] -`; - -exports[`"import" option should work with circular \`@import\`: errors 1`] = `Array []`; - -exports[`"import" option should work with circular \`@import\`: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./relative.css\\"; -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"/*\\\\n // TODO fixed nested circular \`@import\`\\\\n @import url(circular-nested.css);\\\\n*/\\\\n\\\\na {\\\\n color: red;\\\\n}\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with circular \`@import\`: result 1`] = ` -".relative { - color: red; -} -/* - // TODO fixed nested circular \`@import\` - @import url(circular-nested.css); -*/ - -a { - color: red; -} -" -`; - -exports[`"import" option should work with circular \`@import\`: warnings 1`] = `Array []`; - -exports[`"import" option should work with import.filter: errors 1`] = `Array []`; - -exports[`"import" option should work with import.filter: module 1`] = ` -"// Imports -import ___CSS_LOADER_API_IMPORT___ from \\"../../../src/runtime/api.js\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_0___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test-media.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_1___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./test-other.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_2___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./query.css?foo=1&bar=1\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_3___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./other-query.css?foo=1&bar=1#hash\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_4___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./relative.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_5___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./top-relative.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_6___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./node_modules/package/tilde.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_7___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./alias.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_8___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./url.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_9___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./te'st.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_10___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!!!../../helpers/string-loader.js?esModule=false!./node_modules/package/tilde.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_11___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_12___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=bar\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_13___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=bar#hash\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_14___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?bar=foo\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_15___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=bar#one\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_16___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=bar#two\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_17___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=1&bar=2\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_18___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./something.css?foo=2&bar=1\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_19___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./my.scss\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_20___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./package/first.css\\"; -import ___CSS_LOADER_AT_RULE_IMPORT_21___ from \\"-!../../../src/index.js??ruleSet[1].rules[0].use[0]!./node_modules/package/second.css\\"; -import ___CSS_LOADER_GET_URL_IMPORT___ from \\"../../../src/runtime/getUrl.js\\"; -var ___CSS_LOADER_URL_IMPORT_0___ = new URL(\\"./img.png\\", import.meta.url); -var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]}); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"screen and (orientation:landscape)\\"); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_1___, \\"(min-width: 100px)\\"); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css#hash);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css?#hash);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/style.css?foo=bar#hash);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/other-style.css);\\", \\"screen and (orientation:landscape)\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(http://example.com/other-style.css);\\", \\"screen and (orientation:landscape)\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(//example.com/style.css);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_2___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_3___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_3___, \\"screen and (orientation:landscape)\\"); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(https://fonts.googleapis.com/css?family=Roboto);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC);\\"]); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC|Roboto);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_4___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_5___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_6___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_7___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_8___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_9___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_9___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_9___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_9___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_10___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_11___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_11___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_13___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_13___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_12___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_14___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_15___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_16___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_17___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_18___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_19___); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(https://fonts.googleapis.com/css?family=Roboto);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_10___); -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(data:text/css;charset=utf-8,a%20%7B%0D%0A%20%20color%3A%20red%3B%0D%0A%7D);\\"]); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_20___); -___CSS_LOADER_EXPORT___.i(___CSS_LOADER_AT_RULE_IMPORT_21___); -var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___); -// Module -___CSS_LOADER_EXPORT___.push([module.id, \\"@import url(test.css);\\\\n@import url('test.css');\\\\n@import url(\\\\\\"test.css\\\\\\");\\\\n@IMPORT url(test.css);\\\\n@import URL(test.css);\\\\n@import url(test.css );\\\\n@import url( test.css);\\\\n@import url( test.css );\\\\n@import url(\\\\n test.css\\\\n);\\\\n@import url();\\\\n@import url('');\\\\n@import url(\\\\\\"\\\\\\");\\\\n@import \\\\\\"test.css\\\\\\";\\\\n@import 'test.css';\\\\n@import '';\\\\n@import \\\\\\"\\\\\\";\\\\n@import \\\\\\" \\\\\\";\\\\n@import \\\\\\"\\\\n\\\\\\";\\\\n@import url();\\\\n@import url('');\\\\n@import url(\\\\\\"\\\\\\");\\\\n@import url(test.css) screen and (orientation:landscape);\\\\n@import url(test.css) SCREEN AND (ORIENTATION: LANDSCAPE);\\\\n@import url(test.css)screen and (orientation:landscape);\\\\n@import url(test.css) screen and (orientation:landscape);\\\\n@import url(~package/test.css);\\\\n@import ;\\\\n@import foo-bar;\\\\n@import-normalize;\\\\n@import url('http://') :root {}\\\\n\\\\n.class {\\\\n a: b c d;\\\\n}\\\\n\\\\n.foo {\\\\n @import 'path.css';\\\\n}\\\\n\\\\n.background {\\\\n background: url(\\" + ___CSS_LOADER_URL_REPLACEMENT_0___ + \\");\\\\n}\\\\n\\\\n@import url(./test.css);\\\\n\\\\n@import './te\\\\\\\\\\\\nst.css';\\\\n@import './te\\\\\\\\\\\\n\\\\\\\\\\\\n\\\\\\\\\\\\nst.css';\\\\n@import url('./te\\\\\\\\\\\\nst.css');\\\\n@import url('./te\\\\\\\\\\\\n\\\\\\\\\\\\n\\\\\\\\\\\\nst.css');\\\\n@import './test test.css';\\\\n@import url('./test test.css');\\\\n@import './test\\\\\\\\ test.css';\\\\n@import url('./test\\\\\\\\ test.css');\\\\n@import './test%20test.css';\\\\n@import url('./test%20test.css');\\\\n@import './\\\\\\\\74\\\\\\\\65\\\\\\\\73\\\\\\\\74.css';\\\\n@import url('./\\\\\\\\74\\\\\\\\65\\\\\\\\73\\\\\\\\74.css');\\\\n@import './t\\\\\\\\65\\\\\\\\73\\\\\\\\74.css';\\\\n@import url('./t\\\\\\\\65\\\\\\\\73\\\\\\\\74.css');\\\\n@import url(./test\\\\\\\\ test.css);\\\\n@import url(./t\\\\\\\\65st%20test.css);\\\\n@import url('./t\\\\\\\\65st%20test.css');\\\\n@import url(\\\\\\"./t\\\\\\\\65st%20test.css\\\\\\");\\\\n@import \\\\\\"./t\\\\\\\\65st%20test.css\\\\\\";\\\\n@import './t\\\\\\\\65st%20test.css';\\\\n@import url( test.css );\\\\n@import nourl(test.css);\\\\n@import '\\\\\\\\\\\\n\\\\\\\\\\\\n\\\\\\\\\\\\n';\\\\n@import url(test.css?foo=bar);\\\\n@import url(test.css?foo=bar#hash);\\\\n@import url(test.css?#hash);\\\\n@import \\\\\\"test.css\\\\\\" supports(display: flex);\\\\n@import \\\\\\"test.css\\\\\\" supports(display: flex) screen and (orientation:landscape);\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be one import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n/* Should be two import and two css modules */\\\\n\\\\n@import \\\\\\" ./test.css \\\\\\";\\\\n@import url(' ./test.css ');\\\\n@import url( ./test.css );\\\\n@import url('!!../../helpers/string-loader.js?esModule=false!');\\\\n\\\\n/* Prefer relative */\\\\n\\", \\"\\"]); -// Exports -export default ___CSS_LOADER_EXPORT___; -" -`; - -exports[`"import" option should work with import.filter: result 1`] = ` -Array [ - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test-nested-media.css", - "a { - b: b; -} -", - "screen and (orientation:landscape) and (min-width: 100px)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test-media.css", - ".test { - c: c; -} -", - "screen and (orientation:landscape)", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/test-other.css", - ".test { - d: d; -} -", - "(min-width: 100px)", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css#hash);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css?#hash);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/style.css?foo=bar#hash);", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/other-style.css);", - "screen and (orientation:landscape)", - ], - Array [ - "./import/import.css", - "@import url(http://example.com/other-style.css);", - "screen and (orientation:landscape)", - ], - Array [ - "./import/import.css", - "@import url(//example.com/style.css);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/query.css?foo=1&bar=1", - ".query { - e: e; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/other-query.css?foo=1&bar=1#hash", - ".other-query { - f: f; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/other-query.css?foo=1&bar=1#hash", - ".other-query { - f: f; -} -", - "screen and (orientation:landscape)", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Roboto);", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC);", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Noto+Sans+TC|Roboto);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/relative.css", - ".relative { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/top-relative.css", - ".top-relative { - color: black; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/package/tilde.css", - ".tilde { - color: yellow; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/alias.css", - ".alias { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/url.css", - ".background-imported { - background: url(replaced_file_protocol_/webpack/public/path/img.png); -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/te'st.css", - ".strange { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../helpers/string-loader.js?esModule=false!./import/node_modules/package/tilde.css", - "a { color: red };", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#hash", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#hash", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?bar=foo", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#one", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=bar#two", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=1&bar=2", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/something.css?foo=2&bar=1", - ".my-box { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/my.scss", - "a { - color: red; -}", - "", - ], - Array [ - "./import/import.css", - "@import url(https://fonts.googleapis.com/css?family=Roboto);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!../helpers/string-loader.js?esModule=false!./import/node_modules/package/tilde.css", - "a { color: red };", - "", - ], - Array [ - "./import/import.css", - "@import url(data:text/css;charset=utf-8,a%20%7B%0D%0A%20%20color%3A%20red%3B%0D%0A%7D);", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/package/first.css", - ".first { - color: red; -} -", - "", - ], - Array [ - "../../src/index.js??ruleSet[1].rules[0].use[0]!./import/node_modules/package/second.css", - ".second { - color: red; -} -", - "", - ], - Array [ - "./import/import.css", - "@import url(test.css); -@import url('test.css'); -@import url(\\"test.css\\"); -@IMPORT url(test.css); -@import URL(test.css); -@import url(test.css ); -@import url( test.css); -@import url( test.css ); -@import url( - test.css -); -@import url(); -@import url(''); -@import url(\\"\\"); -@import \\"test.css\\"; -@import 'test.css'; -@import ''; -@import \\"\\"; -@import \\" \\"; -@import \\" -\\"; -@import url(); -@import url(''); -@import url(\\"\\"); -@import url(test.css) screen and (orientation:landscape); -@import url(test.css) SCREEN AND (ORIENTATION: LANDSCAPE); -@import url(test.css)screen and (orientation:landscape); -@import url(test.css) screen and (orientation:landscape); -@import url(~package/test.css); -@import ; -@import foo-bar; -@import-normalize; -@import url('http://') :root {} - -.class { - a: b c d; -} - -.foo { - @import 'path.css'; -} - -.background { - background: url(replaced_file_protocol_/webpack/public/path/img.png); -} - -@import url(./test.css); - -@import './te\\\\ -st.css'; -@import './te\\\\ -\\\\ -\\\\ -st.css'; -@import url('./te\\\\ -st.css'); -@import url('./te\\\\ -\\\\ -\\\\ -st.css'); -@import './test test.css'; -@import url('./test test.css'); -@import './test\\\\ test.css'; -@import url('./test\\\\ test.css'); -@import './test%20test.css'; -@import url('./test%20test.css'); -@import './\\\\74\\\\65\\\\73\\\\74.css'; -@import url('./\\\\74\\\\65\\\\73\\\\74.css'); -@import './t\\\\65\\\\73\\\\74.css'; -@import url('./t\\\\65\\\\73\\\\74.css'); -@import url(./test\\\\ test.css); -@import url(./t\\\\65st%20test.css); -@import url('./t\\\\65st%20test.css'); -@import url(\\"./t\\\\65st%20test.css\\"); -@import \\"./t\\\\65st%20test.css\\"; -@import './t\\\\65st%20test.css'; -@import url( test.css ); -@import nourl(test.css); -@import '\\\\ -\\\\ -\\\\ -'; -@import url(test.css?foo=bar); -@import url(test.css?foo=bar#hash); -@import url(test.css?#hash); -@import \\"test.css\\" supports(display: flex); -@import \\"test.css\\" supports(display: flex) screen and (orientation:landscape); - -/* Should be one import and two css modules */ - -/* Should be one import and two css modules */ - -/* Should be one import and two css modules */ - -/* Should be two import and two css modules */ - -/* Should be two import and two css modules */ - -/* Should be two import and two css modules */ - -@import \\" ./test.css \\"; -@import url(' ./test.css '); -@import url( ./test.css ); -@import url('!!../../helpers/string-loader.js?esModule=false!'); - -/* Prefer relative */ -", - "", - ], -] -`; - -exports[`"import" option should work with import.filter: warnings 1`] = ` -Array [ - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(105:1) Unable to find uri in \\"@import nourl(test.css)\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(106:1) Unable to find uri in \\"@import '\\\\ -\\\\ -\\\\ -'\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(12:1) Unable to find uri in \\"@import url()\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(13:1) Unable to find uri in \\"@import url('')\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(14:1) Unable to find uri in \\"@import url(\\"\\")\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(154:1) Unable to find uri in \\"@import url('!!../../helpers/string-loader.js?esModule=false!')\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(17:1) Unable to find uri in \\"@import ''\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(18:1) Unable to find uri in \\"@import \\"\\"\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(19:1) Unable to find uri in \\"@import \\" \\"\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(20:1) Unable to find uri in \\"@import \\" -\\"\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(22:1) Unable to find uri in \\"@import url()\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(23:1) Unable to find uri in \\"@import url('')\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(24:1) Unable to find uri in \\"@import url(\\"\\")\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(40:1) Unable to find uri in \\"@import \\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(41:1) Unable to find uri in \\"@import foo-bar\\"", - "ModuleWarning: Module Warning (from \`replaced original path\`): -Warning - -(43:1) It looks like you didn't end your @import statement correctly. Child nodes are attached to it.", -] -`; diff --git a/test/fixtures/import/import.css b/test/fixtures/import/import.css index b6ec1f907..b15dd6e02 100644 --- a/test/fixtures/import/import.css +++ b/test/fixtures/import/import.css @@ -158,3 +158,18 @@ st.css'); /* Prefer relative */ @import url(package/first.css); @import url(package/second.css); + +@import url("./test.css") supports(display: flex); +@import url("./test.css") supports(display: flex) screen and (min-width: 400px); +@import url("./test.css") layer; +@import url("./test.css") layer(default); +@import url("./test.css") layer(default) supports(display: flex) screen and (min-width: 400px); +@import url("http://example.com/style.css") supports(display: flex) screen and (min-width: 400px); +@import url("./test.css")layer(default)supports(display: flex)screen and (min-width:400px); +@import url("./test.css")screen and (min-width: 400px); +@import url("./test.css") layer( default ) supports( display : flex ) screen and ( min-width : 400px ); +@import url("./test.css") LAYER(DEFAULT) SUPPORTS(DISPLAY: FLEX) SCREEN AND (MIN-WIDTH: 400PX); +@import url("./test.css") /* Comment */ layer(/* Comment */default/* Comment */) /* Comment */ supports(/* Comment */display/* Comment */:/* Comment */ flex/* Comment */)/* Comment */ screen/* Comment */ and/* Comment */ (/* Comment */min-width/* Comment */: /* Comment */400px/* Comment */); + +/* TODO fix comments */ +/* TODO check source maps generation */ diff --git a/test/fixtures/import/import.js b/test/fixtures/import/import.js index 1d033ab23..0b5140a27 100644 --- a/test/fixtures/import/import.js +++ b/test/fixtures/import/import.js @@ -1,5 +1,5 @@ import css from './import.css'; -__export__ = css; +__export__ = css.toString(); export default css; diff --git a/test/import-option.test.js b/test/import-option.test.js index ae41b54db..750eb5bcc 100644 --- a/test/import-option.test.js +++ b/test/import-option.test.js @@ -13,7 +13,7 @@ import { } from "./helpers/index"; describe('"import" option', () => { - it("should work when not specified", async () => { + it.only("should work when not specified", async () => { const compiler = getCompiler("./import/import.js"); const stats = await compile(compiler);