Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

ramon-villain
Copy link
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

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
Copy link

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
Collaborator

@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

@LingyuCoder LingyuCoder merged commit 636d37d into web-infra-dev:main Oct 14, 2024
29 checks passed
@ramon-villain ramon-villain deleted the chore/add-support-to-copied-and-source_filename branch October 14, 2024 20:17
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