For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/rspeedy/rspeedy.cssloadermodules.namedexport.md.
Rspeedy logo
Rspeedy
  • English
  • Home > @lynx-js/rspeedy > CssLoaderModules > namedExport

    CssLoaderModules.namedExport property

    Enables/disables ES modules named export for locals.

    Signature:

    namedExport?: boolean | undefined;

    Default Value

    false

    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.