Skip to content

fix(copy-plugin): support JS input file system for glob copies#14023

Merged
intellild merged 14 commits into
mainfrom
jin/glob_2
May 18, 2026
Merged

fix(copy-plugin): support JS input file system for glob copies#14023
intellild merged 14 commits into
mainfrom
jin/glob_2

Conversation

@intellild
Copy link
Copy Markdown
Contributor

@intellild intellild commented May 12, 2026

Summary

Reland the fast-glob based glob implementation from #13953 after it was reverted in #14010, with follow-up fixes for escaped glob path handling.

This PR also fixes a previous CopyPlugin bug where glob expansion did not use Rspack's JavaScript input file system. CopyPlugin can now resolve copied files through a custom/virtual compiler.inputFileSystem instead of being limited to the native filesystem path.

The glob handling keeps escaped metacharacters such as \[ and \] intact while matching, but unescapes them when deriving the filesystem base directory for traversal. That fixes CopyPlugin patterns whose literal file or directory names contain brackets, such as directory[1] and file[1].txt.

Tests added

  • CopyPlugin coverage for literal bracket paths in file and directory names.
  • CopyPlugin coverage for dotfiles under globbed directories.
  • CopyPlugin coverage for JavaScript/custom input file system support.

Related links

Testing

  • cargo test -p rspack_core glob_utils --lib
  • pnpm run build:binding:dev
  • pnpm --filter @rspack/tests test --project base Config.part3.test.js -t copy-plugin-brackets

Checklist

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

by OpenAI Codex

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

📦 Binary Size-limit

Comparing 9482674 to fix(rslib): emit type-only isolated dts dependencies (#14037) by Timeless0911

🎉 Size decreased by 12.00KB from 62.13MB to 62.12MB (⬇️0.02%)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Rsdoctor Bundle Diff Analysis

Found 6 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
popular-libs 1.7 MB 0
react-10k 5.7 MB 0
react-1k 826.3 KB 0
react-5k 2.7 MB 0
ui-components 4.8 MB 0
rome 1.6 MB 0

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

📝 Rspack Ecosystem CI: Open

suite result
rsdoctor ✅ success
rsbuild ❌ failure
rstest ✅ success
rslib ✅ success
rspress ✅ success
examples ✅ success
lynx-stack ❌ failure
plugin ✅ success
rsbuild-rsc-plugin ✅ success
devserver ✅ success
modernjs ✅ success

@github-actions github-actions Bot added the release: performance release: performance related release(mr only) label May 12, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 12, 2026

Merging this PR will not alter performance

✅ 34 untouched benchmarks
⏩ 25 skipped benchmarks1


Comparing jin/glob_2 (9482674) with main (41524b1)

Open in CodSpeed

Footnotes

  1. 25 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@intellild intellild marked this pull request as ready for review May 13, 2026 02:30
@intellild intellild requested a review from ahabhgk as a code owner May 13, 2026 02:30
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20cb57a1c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_core/src/glob_utils.rs
Comment thread crates/rspack_core/src/glob_utils.rs Outdated
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 14, 2026

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: aed483b
Status: ✅  Deploy successful!
Preview URL: https://01dd61aa.rspack-v2.pages.dev
Branch Preview URL: https://jin-glob-2.rspack-v2.pages.dev

View logs

@intellild intellild requested a review from hardfist May 14, 2026 09:43
@intellild intellild changed the title perf: reduce binary size by unifying glob implementation with fast-glob fix(copy-plugin): support JS input file system for glob copies May 18, 2026
@intellild

This comment was marked as outdated.

@codspeed-hq

This comment was marked as outdated.

@intellild intellild requested a review from SyMind May 18, 2026 11:24
@SyMind
Copy link
Copy Markdown
Member

SyMind commented May 18, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3cfcb9aab4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_plugin_copy/src/lib.rs
SyMind
SyMind previously approved these changes May 18, 2026
Comment thread crates/rspack_core/src/glob_utils.rs
Comment thread crates/rspack_core/src/glob_utils.rs
@intellild intellild enabled auto-merge (squash) May 18, 2026 14:05
@intellild intellild disabled auto-merge May 18, 2026 14:20
@intellild intellild merged commit 7cf1316 into main May 18, 2026
53 of 55 checks passed
@intellild intellild deleted the jin/glob_2 branch May 18, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: performance release: performance related release(mr only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants