From 6a3f57f74d869a33fda8fc1a57df1aff59af859b Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Fri, 10 Jan 2020 19:25:15 +0300 Subject: [PATCH] fix: do not duplicate css on `composes` --- src/runtime/api.js | 20 +- src/utils.js | 4 +- test/__snapshots__/icss.test.js.snap | 4 +- .../__snapshots__/modules-option.test.js.snap | 219 ++++++++++++------ test/modules-option.test.js | 16 ++ test/runtime/api.test.js | 10 +- 6 files changed, 189 insertions(+), 84 deletions(-) diff --git a/src/runtime/api.js b/src/runtime/api.js index bf8a1cbc9..0129e07bc 100644 --- a/src/runtime/api.js +++ b/src/runtime/api.js @@ -22,15 +22,33 @@ module.exports = function(useSourceMap) { // import a list of modules into the list // eslint-disable-next-line func-names - list.i = function(modules, mediaQuery) { + list.i = function(modules, mediaQuery, dedupe) { if (typeof modules === 'string') { // eslint-disable-next-line no-param-reassign modules = [[null, modules, '']]; } + const alreadyImportedModules = {}; + + if (dedupe) { + for (let i = 0; i < this.length; i++) { + // eslint-disable-next-line prefer-destructuring + const id = this[i][0]; + + if (id != null) { + alreadyImportedModules[id] = true; + } + } + } + for (let i = 0; i < modules.length; i++) { const item = [].concat(modules[i]); + if (dedupe && alreadyImportedModules[item[0]]) { + // eslint-disable-next-line no-continue + continue; + } + if (mediaQuery) { if (!item[2]) { item[2] = mediaQuery; diff --git a/src/utils.js b/src/utils.js index bdbf7910e..9fecfcca6 100644 --- a/src/utils.js +++ b/src/utils.js @@ -329,7 +329,7 @@ function getImportCode( case 'icss-import': { const { importName, url, media } = item; - const preparedMedia = media ? `, ${JSON.stringify(media)}` : ''; + const preparedMedia = media ? `, ${JSON.stringify(media)}` : ', ""'; if (!importPrefix) { importPrefix = getImportPrefix(loaderContext, importLoaders); @@ -348,7 +348,7 @@ function getImportCode( ); if (exportType === 'full') { - codeItems.push(`exports.i(${importName}${preparedMedia});`); + codeItems.push(`exports.i(${importName}${preparedMedia}, true);`); } } break; diff --git a/test/__snapshots__/icss.test.js.snap b/test/__snapshots__/icss.test.js.snap index 9956ec3e1..7dfd9713f 100644 --- a/test/__snapshots__/icss.test.js.snap +++ b/test/__snapshots__/icss.test.js.snap @@ -176,7 +176,7 @@ exports[`ICSS show work with the case "import": module 1`] = ` var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./vars.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".className {\\\\n color: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"primary-color\\"] + \\";\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -215,7 +215,7 @@ exports[`ICSS show work with the case "import-reserved-keywords": module 1`] = ` var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./vars.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".className {\\\\n color: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"primary-color\\"] + \\";\\\\n display: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"secondary-color\\"] + \\";\\\\n}\\\\n\\", \\"\\"]); // Exports diff --git a/test/__snapshots__/modules-option.test.js.snap b/test/__snapshots__/modules-option.test.js.snap index 3bedff470..b9bd2fb64 100644 --- a/test/__snapshots__/modules-option.test.js.snap +++ b/test/__snapshots__/modules-option.test.js.snap @@ -7,7 +7,7 @@ exports[`"modules" option issue #286: module 1`] = ` var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"./dep.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".b--main { }\\\\n\\", \\"\\"]); // Exports @@ -44,7 +44,7 @@ exports[`"modules" option issue #636: module 1`] = ` var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../src/index.js??[ident]!./foo.scss\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".prefix-bar {\\\\n}\\", \\"\\"]); // Exports @@ -83,8 +83,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../src/index.js??[ident]!./node_modules/@localpackage/color.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../src/index.js??[ident]!./node_modules/@localpackage/style.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\"._2TvhMv03l8C6o3eyE8OUU3 {\\\\n color: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color-grey\\"] + \\";\\\\n margin: 0;\\\\n padding: 0;\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -370,7 +370,7 @@ exports[`"modules" option should avoid unnecessary "require": module 1`] = ` var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../src/index.js??[ident]!./imported-simple.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._1UgilPFsYxSK4gX5ZkTYCj {\\\\n color: red;\\\\n}\\\\n\\\\n._3V5dPWs_xG519C1PGI1Njd {\\\\n color: red;\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -409,6 +409,77 @@ Array [ exports[`"modules" option should avoid unnecessary "require": warnings 1`] = `Array []`; +exports[`"modules" option should dedupe same modules in one module (issue #1037): errors 1`] = `Array []`; + +exports[`"modules" option should dedupe same modules in one module (issue #1037): module 1`] = ` +"// Imports +var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../src/runtime/api.js\\"); +var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../src/index.js??[ident]!./buttons/primary-button.css\\"); +var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../src/index.js??[ident]!./buttons/secondary-button.css\\"); +exports = ___CSS_LOADER_API_IMPORT___(false); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); +// Module +exports.push([module.id, \\".EzyG7UwnL9VTWJMm1zvyL\\\\n{\\\\n}\\\\n\\\\n.vO79o4trei2_Dt8Bi8s5W\\\\n{\\\\n}\\\\n\\", \\"\\"]); +// Exports +exports.locals = { + \\"nextButton\\": \\"EzyG7UwnL9VTWJMm1zvyL \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"primaryButton\\"] + \\"\\", + \\"backButton\\": \\"vO79o4trei2_Dt8Bi8s5W \\" + ___CSS_LOADER_ICSS_IMPORT_1___.locals[\\"secondaryButton\\"] + \\"\\" +}; +module.exports = exports; +" +`; + +exports[`"modules" option should dedupe same modules in one module (issue #1037): result 1`] = ` +Array [ + Array [ + "../../src/index.js?[ident]!./modules/dedupe/buttons/button.css", + "._2CDoM-NXLchQ7VXiH4UhCN +{ + border:none; + padding:7px 15px; + cursor:pointer; +} +", + "", + ], + Array [ + "../../src/index.js?[ident]!./modules/dedupe/buttons/primary-button.css", + ".z2okwFUvcW0z_ZC8D-5T_ +{ + background-color:blue; + color:white; +} +", + "", + ], + Array [ + "../../src/index.js?[ident]!./modules/dedupe/buttons/secondary-button.css", + ".L9-xT4xBLmBRaK2WDI00c +{ + background-color:#555; + color:white; +} +", + "", + ], + Array [ + "./modules/dedupe/source.css", + ".EzyG7UwnL9VTWJMm1zvyL +{ +} + +.vO79o4trei2_Dt8Bi8s5W +{ +} +", + "", + ], +] +`; + +exports[`"modules" option should dedupe same modules in one module (issue #1037): warnings 1`] = `Array []`; + exports[`"modules" option should keep order: errors 1`] = `Array []`; exports[`"modules" option should keep order: module 1`] = ` @@ -417,8 +488,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../src/index.js??[ident]!./order-1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../src/index.js??[ident]!./order-2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\".Wjk4jowq_W5p9UqAWNj8p {\\\\n display: block;\\\\n}\\\\n\\\\n._1hTJaGPJyAIYbIwkbYwOGW {\\\\n display: inline;\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -863,13 +934,13 @@ var ___CSS_LOADER_AT_RULE_IMPORT_0___ = require(\\"-!../../../../src/index.js??[ var ___CSS_LOADER_GET_URL_IMPORT___ = require(\\"../../../../src/runtime/getUrl.js\\"); var ___CSS_LOADER_URL_IMPORT_0___ = require(\\"../../url/img.png\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); -exports.i(___CSS_LOADER_ICSS_IMPORT_2___); -exports.i(___CSS_LOADER_ICSS_IMPORT_3___); -exports.i(___CSS_LOADER_ICSS_IMPORT_4___); -exports.i(___CSS_LOADER_ICSS_IMPORT_5___); -exports.i(___CSS_LOADER_ICSS_IMPORT_6___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_2___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_3___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_4___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_5___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_6___, \\"\\", true); exports.i(___CSS_LOADER_AT_RULE_IMPORT_0___, \\"(min-width: 100px)\\"); var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___); // Module @@ -3958,7 +4029,7 @@ exports[`"modules" option should work with case \`composes-1\` (\`modules\` valu var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._1DZQbqp1oX8etdFa5oSOnV { b: 1; }\\\\n._1PKuwglb3xQB3gwJBZx6_G { b: 3; }\\\\n._1MtdK0_soIbU20fcYBbRAe { b: 5; }\\\\n\\", \\"\\"]); // Exports @@ -4009,7 +4080,7 @@ exports[`"modules" option should work with case \`composes-1\` (\`modules\` valu var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._1DZQbqp1oX8etdFa5oSOnV { b: 1; }\\\\n._1PKuwglb3xQB3gwJBZx6_G { b: 3; }\\\\n._1MtdK0_soIbU20fcYBbRAe { b: 5; }\\\\n\\", \\"\\"]); // Exports @@ -4060,7 +4131,7 @@ exports[`"modules" option should work with case \`composes-1\` (\`modules\` valu var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._c1 { b: 1; }\\\\n._c3 { b: 3; }\\\\n._c5 { b: 5; }\\\\n\\", \\"\\"]); // Exports @@ -4111,7 +4182,7 @@ exports[`"modules" option should work with case \`composes-1\` (\`modules\` valu var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._c1 { b: 1; }\\\\n._c3 { b: 3; }\\\\n._c5 { b: 5; }\\\\n\\", \\"\\"]); // Exports @@ -4162,7 +4233,7 @@ exports[`"modules" option should work with case \`composes-1\` (\`modules\` valu var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._1DZQbqp1oX8etdFa5oSOnV { b: 1; }\\\\n._1PKuwglb3xQB3gwJBZx6_G { b: 3; }\\\\n._1MtdK0_soIbU20fcYBbRAe { b: 5; }\\\\n\\", \\"\\"]); // Exports @@ -4241,7 +4312,7 @@ exports[`"modules" option should work with case \`composes-2\` (\`modules\` valu var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._2tj5Xzv7Ei8HGFvkrlGXyv { b: 1; }\\\\n._1TPNBQGz_snQ6aGvXARYo0 { b: 3; }\\\\n.rkDOmH5RkgZGaQ5Fey09Z { b: 5; }\\\\n\\", \\"\\"]); // Exports @@ -4292,7 +4363,7 @@ exports[`"modules" option should work with case \`composes-2\` (\`modules\` valu var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._2tj5Xzv7Ei8HGFvkrlGXyv { b: 1; }\\\\n._1TPNBQGz_snQ6aGvXARYo0 { b: 3; }\\\\n.rkDOmH5RkgZGaQ5Fey09Z { b: 5; }\\\\n\\", \\"\\"]); // Exports @@ -4343,7 +4414,7 @@ exports[`"modules" option should work with case \`composes-2\` (\`modules\` valu var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._c1 { b: 1; }\\\\n._c3 { b: 3; }\\\\n._c5 { b: 5; }\\\\n\\", \\"\\"]); // Exports @@ -4394,7 +4465,7 @@ exports[`"modules" option should work with case \`composes-2\` (\`modules\` valu var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._c1 { b: 1; }\\\\n._c3 { b: 3; }\\\\n._c5 { b: 5; }\\\\n\\", \\"\\"]); // Exports @@ -4445,7 +4516,7 @@ exports[`"modules" option should work with case \`composes-2\` (\`modules\` valu var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._2tj5Xzv7Ei8HGFvkrlGXyv { b: 1; }\\\\n._1TPNBQGz_snQ6aGvXARYo0 { b: 3; }\\\\n.rkDOmH5RkgZGaQ5Fey09Z { b: 5; }\\\\n\\", \\"\\"]); // Exports @@ -4526,8 +4597,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\ var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../../src/index.js??[ident]!./file2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\"._1bAv4bLL8-hE3a7MyZXrT- {\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -4576,8 +4647,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\ var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../../src/index.js??[ident]!./file2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\"._1bAv4bLL8-hE3a7MyZXrT- {\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -4626,8 +4697,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\ var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../../src/index.js??[ident]!./file2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\"._abc {\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -4676,8 +4747,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\ var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../../src/index.js??[ident]!./file2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\"._abc {\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -4726,8 +4797,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\ var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../../src/index.js??[ident]!./file2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\"._1bAv4bLL8-hE3a7MyZXrT- {\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -4803,7 +4874,7 @@ exports[`"modules" option should work with case \`composes-with-importing\` (\`m var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._3sT-Lzs6aj6TM9J3mM7_Cj {\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -4843,7 +4914,7 @@ exports[`"modules" option should work with case \`composes-with-importing\` (\`m var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._3sT-Lzs6aj6TM9J3mM7_Cj {\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -4883,7 +4954,7 @@ exports[`"modules" option should work with case \`composes-with-importing\` (\`m var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._abc {\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -4923,7 +4994,7 @@ exports[`"modules" option should work with case \`composes-with-importing\` (\`m var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._abc {\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -4963,7 +5034,7 @@ exports[`"modules" option should work with case \`composes-with-importing\` (\`m var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._3sT-Lzs6aj6TM9J3mM7_Cj {\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -7297,7 +7368,7 @@ exports[`"modules" option should work with case \`media-2\` (\`modules\` value i var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"@media \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"small\\"] + \\" {\\\\n .header {\\\\n box-shadow: 0 0 4px #1F4F7F;\\\\n }\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -7338,7 +7409,7 @@ exports[`"modules" option should work with case \`media-2\` (\`modules\` value i var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"@media \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"small\\"] + \\" {\\\\n .UbDEjEuweJXO7yHMpC8qp {\\\\n box-shadow: 0 0 4px #1F4F7F;\\\\n }\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -7380,7 +7451,7 @@ exports[`"modules" option should work with case \`media-2\` (\`modules\` value i var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"@media \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"small\\"] + \\" {\\\\n .header {\\\\n box-shadow: 0 0 4px #1F4F7F;\\\\n }\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -7421,7 +7492,7 @@ exports[`"modules" option should work with case \`media-2\` (\`modules\` value i var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"@media \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"small\\"] + \\" {\\\\n ._header {\\\\n box-shadow: 0 0 4px #1F4F7F;\\\\n }\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -7463,7 +7534,7 @@ exports[`"modules" option should work with case \`media-2\` (\`modules\` value i var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"@media \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"small\\"] + \\" {\\\\n .UbDEjEuweJXO7yHMpC8qp {\\\\n box-shadow: 0 0 4px #1F4F7F;\\\\n }\\\\n}\\\\n\\", \\"\\"]); // Exports @@ -8822,7 +8893,7 @@ exports[`"modules" option should work with case \`values-3\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".ghi { color: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"def\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -8859,7 +8930,7 @@ exports[`"modules" option should work with case \`values-3\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._29ART3-NNe4DU1X-5_7419 { color: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"def\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -8897,7 +8968,7 @@ exports[`"modules" option should work with case \`values-3\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".ghi { color: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"def\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -8934,7 +9005,7 @@ exports[`"modules" option should work with case \`values-3\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._ghi { color: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"def\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -8972,7 +9043,7 @@ exports[`"modules" option should work with case \`values-3\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._29ART3-NNe4DU1X-5_7419 { color: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"def\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9039,8 +9110,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\ var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../../src/index.js??[ident]!./file2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\".ghi { background: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"def\\"] + \\", \\" + ___CSS_LOADER_ICSS_IMPORT_1___.locals[\\"def\\"] + \\", def; }\\\\n\\", \\"\\"]); // Exports @@ -9085,8 +9156,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\ var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../../src/index.js??[ident]!./file2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\"._1vGjNPdz_qWrUvzTY2pCsS { background: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"def\\"] + \\", \\" + ___CSS_LOADER_ICSS_IMPORT_1___.locals[\\"def\\"] + \\", def; }\\\\n\\", \\"\\"]); // Exports @@ -9132,8 +9203,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\ var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../../src/index.js??[ident]!./file2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\".ghi { background: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"def\\"] + \\", \\" + ___CSS_LOADER_ICSS_IMPORT_1___.locals[\\"def\\"] + \\", def; }\\\\n\\", \\"\\"]); // Exports @@ -9178,8 +9249,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\ var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../../src/index.js??[ident]!./file2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\"._ghi { background: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"def\\"] + \\", \\" + ___CSS_LOADER_ICSS_IMPORT_1___.locals[\\"def\\"] + \\", def; }\\\\n\\", \\"\\"]); // Exports @@ -9225,8 +9296,8 @@ var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\ var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); var ___CSS_LOADER_ICSS_IMPORT_1___ = require(\\"-!../../../../../src/index.js??[ident]!./file2.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); -exports.i(___CSS_LOADER_ICSS_IMPORT_1___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); +exports.i(___CSS_LOADER_ICSS_IMPORT_1___, \\"\\", true); // Module exports.push([module.id, \\"._1vGjNPdz_qWrUvzTY2pCsS { background: \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"def\\"] + \\", \\" + ___CSS_LOADER_ICSS_IMPORT_1___.locals[\\"def\\"] + \\", def; }\\\\n\\", \\"\\"]); // Exports @@ -9299,7 +9370,7 @@ exports[`"modules" option should work with case \`values-5\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".ghi { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\",0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9337,7 +9408,7 @@ exports[`"modules" option should work with case \`values-5\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._3Uw-A6Tr2LkIED6NTqwFvj { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\",0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9376,7 +9447,7 @@ exports[`"modules" option should work with case \`values-5\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".ghi { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\",0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9414,7 +9485,7 @@ exports[`"modules" option should work with case \`values-5\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._ghi { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\",0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9453,7 +9524,7 @@ exports[`"modules" option should work with case \`values-5\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._3Uw-A6Tr2LkIED6NTqwFvj { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\",0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9520,7 +9591,7 @@ exports[`"modules" option should work with case \`values-6\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".ghi { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\" ,0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9558,7 +9629,7 @@ exports[`"modules" option should work with case \`values-6\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._2qKjolC-wu9Dp8-RCkWiLN { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\" ,0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9597,7 +9668,7 @@ exports[`"modules" option should work with case \`values-6\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".ghi { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\" ,0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9635,7 +9706,7 @@ exports[`"modules" option should work with case \`values-6\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._ghi { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\" ,0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9674,7 +9745,7 @@ exports[`"modules" option should work with case \`values-6\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._2qKjolC-wu9Dp8-RCkWiLN { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\" ,0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9741,7 +9812,7 @@ exports[`"modules" option should work with case \`values-7\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".ghi { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\", 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9779,7 +9850,7 @@ exports[`"modules" option should work with case \`values-7\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._1SVUxnI1T0vYEcq2VXU5pr { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\", 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9818,7 +9889,7 @@ exports[`"modules" option should work with case \`values-7\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\".ghi { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\", 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9856,7 +9927,7 @@ exports[`"modules" option should work with case \`values-7\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._ghi { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\", 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports @@ -9895,7 +9966,7 @@ exports[`"modules" option should work with case \`values-7\` (\`modules\` value var ___CSS_LOADER_API_IMPORT___ = require(\\"../../../../../src/runtime/api.js\\"); var ___CSS_LOADER_ICSS_IMPORT_0___ = require(\\"-!../../../../../src/index.js??[ident]!./file1.css\\"); exports = ___CSS_LOADER_API_IMPORT___(false); -exports.i(___CSS_LOADER_ICSS_IMPORT_0___); +exports.i(___CSS_LOADER_ICSS_IMPORT_0___, \\"\\", true); // Module exports.push([module.id, \\"._1SVUxnI1T0vYEcq2VXU5pr { box-shadow: 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\", 0 0 \\" + ___CSS_LOADER_ICSS_IMPORT_0___.locals[\\"color\\"] + \\"; }\\\\n\\", \\"\\"]); // Exports diff --git a/test/modules-option.test.js b/test/modules-option.test.js index d16e59274..6ba9d5fb9 100644 --- a/test/modules-option.test.js +++ b/test/modules-option.test.js @@ -549,4 +549,20 @@ describe('"modules" option', () => { expect(getWarnings(stats)).toMatchSnapshot('warnings'); expect(getErrors(stats)).toMatchSnapshot('errors'); }); + + it('should dedupe same modules in one module (issue #1037)', async () => { + const compiler = getCompiler('./modules/dedupe/source.js', { + modules: true, + }); + const stats = await compile(compiler); + + expect( + getModuleSource('./modules/dedupe/source.css', stats) + ).toMatchSnapshot('module'); + expect(getExecutedCode('main.bundle.js', compiler, stats)).toMatchSnapshot( + 'result' + ); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(getErrors(stats)).toMatchSnapshot('errors'); + }); }); diff --git a/test/runtime/api.test.js b/test/runtime/api.test.js index 8ff7a5d5a..ced44a649 100644 --- a/test/runtime/api.test.js +++ b/test/runtime/api.test.js @@ -101,9 +101,7 @@ describe('api', () => { expect(m.toString()).toMatchSnapshot(); }); - it('should toString without source mapping if btoa not available', () => { - global.btoa = null; - + it('should toString with a source map without "sourceRoot"', () => { const m = api(true); m.push([ @@ -114,14 +112,15 @@ describe('api', () => { file: 'test.scss', sources: ['./path/to/test.scss'], mappings: 'AAAA;', - sourceRoot: 'webpack://', }, ]); expect(m.toString()).toMatchSnapshot(); }); - it.only('should toString with a source map without "sourceRoot"', () => { + it('should toString without source mapping if btoa not available', () => { + global.btoa = null; + const m = api(true); m.push([ @@ -132,6 +131,7 @@ describe('api', () => { file: 'test.scss', sources: ['./path/to/test.scss'], mappings: 'AAAA;', + sourceRoot: 'webpack://', }, ]);