Skip to content

feat: support caseSensitive in import.meta.glob#14811

Draft
intellild wants to merge 9 commits into
mainfrom
codex/import-meta-glob-case-sensitive
Draft

feat: support caseSensitive in import.meta.glob#14811
intellild wants to merge 9 commits into
mainfrom
codex/import-meta-glob-case-sensitive

Conversation

@intellild

Copy link
Copy Markdown
Contributor

Summary

  • add import.meta.glob support for the caseSensitive option
  • default to case-sensitive matching and allow caseSensitive: false for case-insensitive positive and negative glob patterns
  • preserve filesystem path casing in returned object keys
  • warn once and fall back to true when the option is not a statically evaluated boolean
  • expose the option in public types and document it in English and Chinese

Example

const modules = import.meta.glob("./components/*.JS", {
  eager: true,
  caseSensitive: false,
});

For example, this can match ./components/button.js even though the pattern uses .JS. The returned key remains ./components/button.js, preserving the filesystem spelling. Omitting the option keeps the existing case-sensitive behavior.

The matching mode is included in context dependency and module identity so otherwise identical glob calls cannot incorrectly reuse modules across different case-sensitivity settings.

Related links

Validation

  • cargo fmt --all --check
  • cargo check -p rspack_core -p rspack_plugin_javascript
  • pnpm run build:binding:dev
  • focused context and invalid-value Rstest cases: 4/4 variants passed for each filter
  • pnpm run test:type
  • Prettier checks for changed JavaScript, TypeScript, and documentation files
  • normalized webpack content diff: no remaining caseSensitive test-content gaps

Checklist

  • Tests updated.
  • Documentation updated.

by OpenAI Codex

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: 14bcc88
Status: ✅  Deploy successful!
Preview URL: https://62779a90.rspack-v2.pages.dev
Branch Preview URL: https://codex-import-meta-glob-case.rspack-v2.pages.dev

View logs

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing cc6e5f9 to refactor(core): improve referenced export data struct (#14796) by Cong-Cong Pan

❌ Size increased by 16.00KB from 66.59MB to 66.61MB (⬆️0.02%)

@codspeed-hq

codspeed-hq Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 47 skipped benchmarks1


Comparing codex/import-meta-glob-case-sensitive (cc6e5f9) with main (25274d8)

Open in CodSpeed

Footnotes

  1. 47 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

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown

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: 14bcc88224

ℹ️ 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/context_module_factory.rs
@github-actions

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
popular-libs 1.7 MB 551.8 KB 0 0
react-10k 5.6 MB 1.3 MB 0 0
react-1k 823.1 KB 217.0 KB 0 0
react-5k 2.7 MB 663.8 KB 0 0
ui-components 4.9 MB 1.4 MB 0 0

Generated by Rsdoctor GitHub Action

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant