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

fix!: handle glob patterns ending with /** in CopyRspackPlugin #8803

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

inottn
Copy link
Collaborator

@inottn inottn commented Dec 22, 2024

Summary

Attention: This PR includes a breaking change, but it is necessary to align with webpack's behavior.

fix #8801

A glob pattern ending with /** should match all files within a directory, not just the directory itself.
Since the standard glob only matches directories (refer to rust-lang/glob#129), we append /* to align with webpack's behavior.

Checklist

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

@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label Dec 22, 2024
Copy link

netlify bot commented Dec 22, 2024

Deploy Preview for rspack canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 60ca36f
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/676792adb0339100089c62c4

Copy link

codspeed-hq bot commented Dec 22, 2024

CodSpeed Performance Report

Merging #8803 will not alter performance

Comparing inottn:fix/copy (60ca36f) with main (ed67e97)

Summary

✅ 1 untouched benchmarks

@hardfist
Copy link
Contributor

hardfist commented Dec 22, 2024

if the glob library behaves different from webpack's glob library, maybe we should consider align glob crate behavior to globby, I'm not sure the fast-glob behaves the same as globby @shulaoda can you help check?, if it behaves the same maybe we use fast-glob in copyRspackPlugin.

BTW this is actually a breaking and should be emphasized in notice

@shulaoda
Copy link
Collaborator

shulaoda commented Dec 22, 2024

I'm not sure the fast-glob behaves the same as globby

Yes, it aligns with the glob pattern used by webpack and includes corresponding test cases.

see https://github.com/shulaoda/fast-glob/blob/2fa17673ba4ba599a7ad21221867dc71557be68b/tests/test.rs#L8

@inottn
Copy link
Collaborator Author

inottn commented Dec 22, 2024

BTW this is actually a breaking and should be emphasized in notice

Okay, sometimes it's hard to distinguish between fixing and breaking. I'll revise the corresponding description later to emphasize that.

@inottn
Copy link
Collaborator Author

inottn commented Dec 22, 2024

@shulaoda fast-glob's API looks very concise. Can you help me confirm if it supports the globOptions configuration for use in the CopyRspackPlugin?

@hardfist
Copy link
Contributor

hardfist commented Dec 22, 2024

Okay, sometimes it's hard to distinguish between fixing and breaking. I'll revise the corresponding description later to emphasize that.

yeah this is tricky maybe we should have some label like “alignment breaking” which means the small
breaking introduced for alignment which is allowed in minor release

@shulaoda
Copy link
Collaborator

@shulaoda fast-glob's API looks very concise. Can you help me confirm if it supports the globOptions configuration for use in the CopyRspackPlugin?

Yes, fast-glob only supports simple matching and doesn't support additional extensions, as these could lead to performance degradation. For more details, you can refer to #7556 related attempts made by @SyMind.

@inottn inottn changed the title fix: handle glob patterns ending with /** in CopyRspackPlugin fix!: handle glob patterns ending with /** in CopyRspackPlugin Dec 22, 2024
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: webpack copy-webpack-plugin migration problem
3 participants