feat: allow to custom Wasm filename hash#5807
Merged
chenjiahan merged 7 commits intomainfrom Aug 10, 2025
Merged
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enables customization of Wasm filename hashes through the output.filenameHash configuration and updates the default hash format from [hash] to the shorter [contenthash:8] for Wasm files.
- Modified the
getFilenamehelper function to respect thefilenameHashconfiguration for Wasm files - Updated default Wasm filename pattern from
[hash].module.wasmto[contenthash:8].module.wasm - Added test case to verify custom filename hash functionality
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/helpers/index.ts | Modified getFilename function to support customizable hash for Wasm files |
| website/docs/zh/guide/basic/wasm-assets.mdx | Updated documentation example to reflect new default hash format |
| website/docs/zh/config/output/filename.mdx | Updated configuration documentation with new default Wasm filename pattern |
| website/docs/en/guide/basic/wasm-assets.mdx | Updated English documentation example with new default hash format |
| website/docs/en/config/output/filename.mdx | Updated English configuration documentation with new default pattern |
| e2e/cases/wasm/wasm-filename-hash/src/index.js | Added test source file for custom Wasm filename hash functionality |
| e2e/cases/wasm/wasm-filename-hash/rsbuild.config.ts | Added test configuration using custom fullhash:16 format |
| e2e/cases/wasm/wasm-filename-hash/index.test.ts | Added test to verify custom filename hash works correctly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
output.filenameHash[contenthash:8]instead of[hash]by defaultChecklist