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"]);
除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。