Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jdelStrother
Copy link

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
Author

Anything we can do to help get this merged?

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