You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/__snapshots__/modules-option.test.js.snap
+149Lines changed: 149 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1749,6 +1749,15 @@ Error: The \\"modules.namedExport\\" option requires the \\"esModules\\" option
1749
1749
1750
1750
exports[`"modules" option should throw an error when the "namedExport" option is "true", but the "esModule" is "false": warnings 1`] = `Array []`;
1751
1751
1752
+
exports[`"modules" option should throw error when the "namedExport" function throw error: errors 1`] = `
1753
+
Array [
1754
+
"ModuleBuildError: Module build failed (from \`replaced original path\`):
1755
+
Error: namedExportFn error",
1756
+
]
1757
+
`;
1758
+
1759
+
exports[`"modules" option should throw error when the "namedExport" function throw error: warnings 1`] = `Array []`;
1760
+
1752
1761
exports[`"modules" option should throw error with composes when the "namedExport" is enabled and "exportLocalsConvention" options has invalid value: errors 1`] = `
1753
1762
Array [
1754
1763
"ModuleBuildError: Module build failed (from \`replaced original path\`):
@@ -4606,6 +4615,52 @@ h1 #pWzFEVR2SnlD5kUmOw_N {
4606
4615
4607
4616
exports[`"modules" option should work and support "pure" mode: warnings 1`] = `Array []`;
4608
4617
4618
+
exports[`"modules" option should work js template with "namedExport" option when "namedExport" option is function: errors 1`] = `Array []`;
4619
+
4620
+
exports[`"modules" option should work js template with "namedExport" option when "namedExport" option is function: module 1`] = `
4621
+
"// Imports
4622
+
import ___CSS_LOADER_API_IMPORT___ from \\"../../../../../src/runtime/api.js\\";
4623
+
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]});
exports[`"modules" option should work js template with "namedExport" option when "namedExport" option is function: result 1`] = `
4635
+
Object {
4636
+
"css": Array [
4637
+
Array [
4638
+
"./modules/namedExport/template-2/index.css",
4639
+
".header-baz {
4640
+
color: red;
4641
+
}
4642
+
4643
+
.body {
4644
+
color: coral;
4645
+
}
4646
+
4647
+
.footer {
4648
+
color: blue;
4649
+
}
4650
+
",
4651
+
"",
4652
+
],
4653
+
],
4654
+
"html": "
4655
+
<div class=\\"header-baz\\">
4656
+
<div class=\\"body\\">
4657
+
<div class=\\"footer\\">
4658
+
",
4659
+
}
4660
+
`;
4661
+
4662
+
exports[`"modules" option should work js template with "namedExport" option when "namedExport" option is function: warnings 1`] = `Array []`;
4663
+
4609
4664
exports[`"modules" option should work js template with "namedExport" option: errors 1`] = `Array []`;
4610
4665
4611
4666
exports[`"modules" option should work js template with "namedExport" option: module 1`] = `
@@ -4805,6 +4860,39 @@ Array [
4805
4860
4806
4861
exports[`"modules" option should work when the "namedExport" is enabled and the "exportLocalsConvention" options has "dashesOnly" value: warnings 1`] = `Array []`;
4807
4862
4863
+
exports[`"modules" option should work when the "namedExport" option is function: errors 1`] = `Array []`;
4864
+
4865
+
exports[`"modules" option should work when the "namedExport" option is function: module 1`] = `
4866
+
"// Imports
4867
+
import ___CSS_LOADER_API_IMPORT___ from \\"../../../../../src/runtime/api.js\\";
4868
+
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]});
export var bar_baz_TEST = \\"_pV82SQbfroU2_cQrb3p\\";
4873
+
export default ___CSS_LOADER_EXPORT___;
4874
+
"
4875
+
`;
4876
+
4877
+
exports[`"modules" option should work when the "namedExport" option is function: result 1`] = `
4878
+
Array [
4879
+
Array [
4880
+
"./modules/namedExport/base/index.css",
4881
+
"._pV82SQbfroU2_cQrb3p {
4882
+
color: red;
4883
+
}
4884
+
4885
+
.bar {
4886
+
color: red;
4887
+
}
4888
+
",
4889
+
"",
4890
+
],
4891
+
]
4892
+
`;
4893
+
4894
+
exports[`"modules" option should work when the "namedExport" option is function: warnings 1`] = `Array []`;
4895
+
4808
4896
exports[`"modules" option should work with "exportOnlyLocals" and "esModule" with "false" value options: errors 1`] = `Array []`;
4809
4897
4810
4898
exports[`"modules" option should work with "exportOnlyLocals" and "esModule" with "false" value options: module 1`] = `
@@ -13473,6 +13561,67 @@ Array [
13473
13561
13474
13562
exports[`"modules" option should work with composes when the "namedExport" is enabled and "exportLocalsConvention" options has "dashesOnly" value: warnings 1`] = `Array []`;
13475
13563
13564
+
exports[`"modules" option should work with composes when the "namedExport" is function: errors 1`] = `Array []`;
13565
+
13566
+
exports[`"modules" option should work with composes when the "namedExport" is function: module 1`] = `
13567
+
"// Imports
13568
+
import ___CSS_LOADER_API_IMPORT___ from \\"../../../../../src/runtime/api.js\\";
13569
+
import ___CSS_LOADER_ICSS_IMPORT_0___, * as ___CSS_LOADER_ICSS_IMPORT_0____NAMED___ from \\"-!../../../../../src/index.js??ruleSet[1].rules[0].use[0]!./values.css\\";
13570
+
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]});
0 commit comments