Home > @lynx-js/rspeedy > CssLoaderModules > namedExport

CssLoaderModules.namedExport property

Enables/disables ES modules named export for locals.

Signature:

namedExport?: boolean | undefined;

Example

  • style.css
.foo-baz {
  color: red;
}
.bar {
  color: blue;
}
.default {
  color: green;
}
  • index.js
import * as styles from "./styles.css";

// If using `exportLocalsConvention: "as-is"` (default value):
console.log(styles["foo-baz"], styles.bar);

// If using `exportLocalsConvention: "camel-case-only"`:
console.log(styles.fooBaz, styles.bar);

// For the `default` class name
console.log(styles["_default"]);
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.