Skip to content

Fix named exports, add css-loader 7 support#93

Open
jdelStrother wants to merge 2 commits intoTeamSupercell:masterfrom
jdelStrother:css-loader-7
Open

Fix named exports, add css-loader 7 support#93
jdelStrother wants to merge 2 commits intoTeamSupercell:masterfrom
jdelStrother:css-loader-7

Conversation

@jdelStrother
Copy link
Copy Markdown

css-loader 7 defaults to named exports in the css - eg

// Imports
import ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from "../node_modules/css-loader/dist/runtime/noSourceMaps.js";
import ___CSS_LOADER_API_IMPORT___ from "../node_modules/css-loader/dist/runtime/api.js";
import ___CSS_LOADER_ICSS_IMPORT_0___, * as ___CSS_LOADER_ICSS_IMPORT_0____NAMED___ from "-!../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./example-shared.css";
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
___CSS_LOADER_EXPORT___.i(___CSS_LOADER_ICSS_IMPORT_0___, "", true);
// Module
___CSS_LOADER_EXPORT___.push([module.id, ".nebQsrLtrM33XOPOAV0d {\n  color: white;\n}\n\n.vUAoNtkdxlUMvNCQvVEj {\n  color: green;\n}\n\n.Z8l2Dbal4vZ3rn2gu33u {\n}\n", ""]);
// Exports
export var foo = "nebQsrLtrM33XOPOAV0d";
var _1 = "vUAoNtkdxlUMvNCQvVEj";
export { _1 as "bar-baz" };
export var composed = "Z8l2Dbal4vZ3rn2gu33u " + ___CSS_LOADER_ICSS_IMPORT_0____NAMED___["shared-style"] + "";
export default ___CSS_LOADER_EXPORT___;

I've added css-loader 7 to the test suite and fixed getCssModuleKeys to support both styles of exports.

Fixes #65

@jdelStrother
Copy link
Copy Markdown
Author

Anything we can do to help get this merged?

@na9da na9da mentioned this pull request Dec 5, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does not work with css-loader 6 + esmodules + namedExport: true

1 participant