fix: do not allow to disable filename hash of Wasm files#5854
Merged
chenjiahan merged 4 commits intomainfrom Aug 15, 2025
Merged
fix: do not allow to disable filename hash of Wasm files#5854chenjiahan merged 4 commits intomainfrom
chenjiahan merged 4 commits intomainfrom
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 fix ensures that Wasm files always include a content hash in their filename, even when filenameHash: false is configured, addressing a limitation where Rspack doesn't support the [name] placeholder for Wasm filenames.
- Modified the
getFilenamefunction to force hash generation for Wasm files regardless of the globalfilenameHashsetting - Added test coverage to verify that Wasm files maintain their hash even when filename hashing is disabled
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/helpers/index.ts | Updates Wasm filename generation logic to always include hash |
| e2e/cases/wasm/wasm-filename-hash-disabled/src/index.js | Test file that imports a Wasm module |
| e2e/cases/wasm/wasm-filename-hash-disabled/rsbuild.config.ts | Test configuration with filename hashing disabled |
| e2e/cases/wasm/wasm-filename-hash-disabled/index.test.ts | Test verifying Wasm files retain hash when hashing is disabled |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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
Considering that Rspack does not support the
[name]placeholder for Wasm filenames, we should not allow to disable filename hash of Wasm files viaoutput.filenameHash: false.Related Links
[name]placeholder in webassemblyModuleFilename is rendered incorrectly rspack#11351Checklist