Skip to content

feat: allow to custom Wasm filename hash#5807

Merged
chenjiahan merged 7 commits intomainfrom
wasm_filename_hash_0810
Aug 10, 2025
Merged

feat: allow to custom Wasm filename hash#5807
chenjiahan merged 7 commits intomainfrom
wasm_filename_hash_0810

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

  • Allow to custom Wasm filename hash via output.filenameHash
  • Wasm files now use the shorter [contenthash:8] instead of [hash] by default

Checklist

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

Copilot AI review requested due to automatic review settings August 10, 2025 03:36
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 10, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit b468d4d
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/6898594c6ad27f000887f51e
😎 Deploy Preview https://deploy-preview-5807--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: 68 (🔴 down 6 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 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 getFilename helper function to respect the filenameHash configuration for Wasm files
  • Updated default Wasm filename pattern from [hash].module.wasm to [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

@chenjiahan chenjiahan merged commit c660d01 into main Aug 10, 2025
11 checks passed
@chenjiahan chenjiahan deleted the wasm_filename_hash_0810 branch August 10, 2025 08:38
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.

2 participants