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.cssmodules.localidentname.md.
Rspeedy logo
Rspeedy
  • English
  • Home > @lynx-js/rspeedy > CssModules > localIdentName

    CssModules.localIdentName property

    Sets the format of the className generated by CSS Modules after compilation.

    Signature:

    localIdentName?: string | undefined;

    Default Value

    '[local]-[hash:base64:6]'

    Remarks

    Available placeholders:

    • [local]: Original class name

    • [hash]: Hash of the class name

    • [path]: File path

    • [name]: File name

    • [ext]: File extension

    See css-loader#localIdentName for details.

    Example 1

    Use only hash for shorter class names:

    import { defineConfig } from '@lynx-js/rspeedy'
    export default defineConfig({
      output: {
        cssModules: {
          localIdentName: '[hash:base64:8]',
        },
      },
    })

    Example 2

    Include file name for debugging:

    import { defineConfig } from '@lynx-js/rspeedy'
    export default defineConfig({
      output: {
        cssModules: {
          localIdentName: '[name]__[local]--[hash:base64:5]',
        },
      },
    })
    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.