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;

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.

除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。