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.output.filenamehash.md.
Rspeedy logo
Rspeedy
  • English
  • Home > @lynx-js/rspeedy > Output > filenameHash

    Output.filenameHash property

    The Output.filenameHash option controls whether to add a hash value to the filename after the production build.

    Signature:

    filenameHash?: boolean | string | undefined;

    Default Value

    In production web builds, Rsbuild defaults this option to true; development builds and non-web outputs omit hashes by default.

    Remarks

    Output.filename has a higher priority than Output.filenameHash.

    Example 1

    • Disable hash
    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      output: {
        filenameHash: false,
      },
    })

    Example 2

    • Change hash format
    import { defineConfig } from '@lynx-js/rspeedy'
    
    export default defineConfig({
      output: {
        filenameHash: 'fullhash:16',
      },
    })

    The available hash formats are:

    • fullhash: The hash value of the entire compilation. If any file changes, the hash values of all output files in the entire project will change.

    • chunkhash: The hash value of the chunk. The hash value will only change when the content of the chunk (and its included modules) changes.

    • contenthash: The hash value of the file content. The hash value will only change when the content of the file itself changes.

    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.