Skip to content

fix: should transform output.path while emitting assets#12181

Merged
LingyuCoder merged 2 commits intomainfrom
fix/fullhash-in-path
Nov 13, 2025
Merged

fix: should transform output.path while emitting assets#12181
LingyuCoder merged 2 commits intomainfrom
fix/fullhash-in-path

Conversation

@LingyuCoder
Copy link
Copy Markdown
Contributor

Summary

fix #11940

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 06:18
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 13, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 3bf9014
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/691579a40dc0eb0008d4bfb9

@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
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 issue #11940 by ensuring that the output.path configuration is properly transformed (template placeholders like [fullhash] are replaced) before emitting assets and cleaning output directories.

Key Changes:

  • Added a From<&Utf8PathBuf> trait implementation for Filename to support path-to-filename conversion
  • Modified emit_assets() to transform output.path templates before use and pass the transformed path to downstream functions
  • Updated run_clean_options() to accept a transformed output_path parameter for proper directory cleaning

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/rspack-test/configCases/output/path-template/rspack.config.js Adds test to verify that template placeholders in output.path are transformed and literal placeholder names are not created as directories
tests/rspack-test/configCases/output/path-template/index.js Minimal test entry point for the path template test case
tests/rspack-test/Incremental-node.test.js Removes exclusion for rebuild-abnormal-module test, indicating the fix resolves a previously failing incremental build test
crates/rspack_core/src/options/filename.rs Adds From trait implementation to convert Utf8PathBuf references into Filename for template processing
crates/rspack_core/src/compiler/mod.rs Transforms output.path before emitting assets and passes the transformed path to cleaning and emission functions

💡 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 3bf9014 to chore(ci): revert cache action version (#12170) by pshu

❌ Size increased by 1.75KB 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 #12181 will not alter performance

Comparing fix/fullhash-in-path (3bf9014) with main (1126c09)

Summary

✅ 17 untouched

@LingyuCoder LingyuCoder changed the title fix: should transform output.path while emitting assets fix: should transform output.path while emitting assets Nov 13, 2025
@LingyuCoder LingyuCoder requested a review from ahabhgk November 13, 2025 07:06
@LingyuCoder LingyuCoder enabled auto-merge (squash) November 13, 2025 07:06
@LingyuCoder LingyuCoder merged commit 6631901 into main Nov 13, 2025
70 of 72 checks passed
@LingyuCoder LingyuCoder deleted the fix/fullhash-in-path branch November 13, 2025 08:40
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]: Output path template [fullhash] not replaced with hash string

3 participants