Skip to content

fix: do not allow to disable filename hash of Wasm files#5854

Merged
chenjiahan merged 4 commits intomainfrom
wasm_disable_filename_hash_0815
Aug 15, 2025
Merged

fix: do not allow to disable filename hash of Wasm files#5854
chenjiahan merged 4 commits intomainfrom
wasm_disable_filename_hash_0815

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

Considering that Rspack does not support the [name] placeholder for Wasm filenames, we should not allow to disable filename hash of Wasm files via output.filenameHash: false.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings August 15, 2025 09:25
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 15, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 29c293a
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/689f018313a70f0008947bab
😎 Deploy Preview https://deploy-preview-5854--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 62 (🔴 down 26 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 getFilename function to force hash generation for Wasm files regardless of the global filenameHash setting
  • 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.

@chenjiahan chenjiahan merged commit 1f0e34c into main Aug 15, 2025
11 checks passed
@chenjiahan chenjiahan deleted the wasm_disable_filename_hash_0815 branch August 15, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: × Conflict: Multiple assets emit different content to the same filename static/wasm/.module.wasm

2 participants