Skip to content

feat!: update default include regex#99

Merged
chenjiahan merged 1 commit intomainfrom
default_include_0408
Apr 8, 2026
Merged

feat!: update default include regex#99
chenjiahan merged 1 commit intomainfrom
default_include_0408

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Updates the default file matching pattern for the React Refresh loader to better align with modern JavaScript and TypeScript file extensions.

Copilot AI review requested due to automatic review settings April 8, 2026 02:54
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: c1d57680b1

ℹ️ 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".

): NormalizedPluginOptions {
d(options, 'exclude', /node_modules/i);
d(options, 'include', /\.([cm]js|[jt]sx?|flow)$/i);
d(options, 'include', /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore case-insensitive default include regex

The new default include pattern is now case-sensitive, so files like Component.TSX or App.JS no longer match and won’t get builtin:react-refresh-loader applied. This is a regression from the previous /.../i behavior and can silently disable Fast Refresh in projects that use uppercase or mixed-case extensions (common on case-insensitive filesystems or legacy repos).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the plugin’s default include pattern used to decide which files get processed by the built-in React Refresh loader, aligning it with modern JS/TS extension variants.

Changes:

  • Updated the documented default include regex in PluginOptions to enumerate JS/TS extensions explicitly.
  • Updated normalizeOptions() to use the new default include regex.
  • Updated README option documentation to match the new default.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/options.ts Changes the default include matcher used at runtime and in the TypeScript docs.
README.md Updates the documented include default regex shown to users.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit 1f5a44a into main Apr 8, 2026
8 checks passed
@chenjiahan chenjiahan deleted the default_include_0408 branch April 8, 2026 03:05
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.

2 participants