Skip to content

feat(rspack_plugin_copy): Set source_filename and copied flag when copying an asset#8077

Merged
LingyuCoder merged 4 commits intoweb-infra-dev:mainfrom
ramon-villain:chore/add-support-to-copied-and-source_filename
Oct 14, 2024
Merged

feat(rspack_plugin_copy): Set source_filename and copied flag when copying an asset#8077
LingyuCoder merged 4 commits intoweb-infra-dev:mainfrom
ramon-villain:chore/add-support-to-copied-and-source_filename

Conversation

@ramon-villain
Copy link
Copy Markdown
Contributor

Summary

This PR adds a new copied flag to the AssetInfo structure in Rspack and sets the source_filename attr when copying a file.

Key changes include:

  1. Added copied field to JsAssetInfo, AssetInfo, and StatsAssetInfo structures.
  2. Updated the CopyPlugin to set the copied flag and sourceFilename when copying assets.
  3. Modified the stats printer to display the "copied" flag in asset information.
  4. Updated TypeScript definitions and API documentation to reflect these changes.

This aligns Rspack more closely with webpack's behavior regarding copied assets.

Checklist

  • Tests updated (or not required).
    • Updated CopyPlugin.test.js to include assertions for the new copied flag.
  • Documentation updated (or not required).
    • Updated api.md to include the new copied field in KnownAssetInfo.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 9, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Oct 9, 2024
@netlify
Copy link
Copy Markdown

netlify bot commented Oct 9, 2024

Deploy Preview for rspack canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 783482d
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/670c9adaea72ca000812bb1f

@ramon-villain ramon-villain force-pushed the chore/add-support-to-copied-and-source_filename branch 2 times, most recently from afe6744 to 16e1059 Compare October 10, 2024 06:06
@ramon-villain ramon-villain force-pushed the chore/add-support-to-copied-and-source_filename branch from 8fa25c7 to cfcd035 Compare October 10, 2024 06:34
Copy link
Copy Markdown
Contributor

@LingyuCoder LingyuCoder left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants