Skip to content

fix: should not transform [name]/[file] in wasm filename template#12184

Merged
LingyuCoder merged 1 commit intomainfrom
fix/wasm-template-name-placeholder
Nov 13, 2025
Merged

fix: should not transform [name]/[file] in wasm filename template#12184
LingyuCoder merged 1 commit intomainfrom
fix/wasm-template-name-placeholder

Conversation

@LingyuCoder
Copy link
Copy Markdown
Contributor

Summary

fix #11351, align with webpack

Related links

Checklist

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

Copilot AI review requested due to automatic review settings November 13, 2025 07:14
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 13, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 2dd90c4
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69158574024a6200084ff442

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 13, 2025
@LingyuCoder LingyuCoder requested a review from ahabhgk November 13, 2025 07:15
@LingyuCoder LingyuCoder enabled auto-merge (squash) November 13, 2025 07:15
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 fixes an issue where [name] and [file] placeholders in WebAssembly module filenames were being incorrectly transformed, aligning rspack's behavior with webpack. The fix removes a .filename() call that was causing these unsupported placeholders to be replaced with actual values.

  • Removes the .filename() call from wasm name rendering to prevent unwanted placeholder transformation
  • Adds a test case to verify that [name] placeholder remains literal in wasm filename templates
  • Ensures only supported placeholders ([id], [hash], [contenthash]) are transformed for wasm files

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
crates/rspack_plugin_wasm/src/parser_and_generator.rs Removes .filename() call from PathData builder to prevent transformation of [name] and [file] placeholders
tests/rspack-test/configCases/wasm/not-support-placeholder/rspack.config.js Adds test configuration to verify [name] placeholder remains literal in output
tests/rspack-test/configCases/wasm/not-support-placeholder/index.js Adds test case importing and testing wasm functionality
tests/rspack-test/configCases/wasm/not-support-placeholder/factorial.wasm Adds wasm binary file for testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 2dd90c4 to chore(ci): revert cache action version (#12170) by pshu

❌ Size increased by 128bytes from 48.10MB to 48.10MB (⬆️0.00%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 13, 2025

CodSpeed Performance Report

Merging #12184 will not alter performance

Comparing fix/wasm-template-name-placeholder (2dd90c4) with main (12281db)

Summary

✅ 17 untouched

@LingyuCoder LingyuCoder merged commit b20fd92 into main Nov 13, 2025
53 checks passed
@LingyuCoder LingyuCoder deleted the fix/wasm-template-name-placeholder branch November 13, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [name] placeholder in webassemblyModuleFilename is rendered incorrectly

3 participants