Skip to content

fix: handle missing loader paths - #84

Merged
chenjiahan merged 1 commit into
mainfrom
fix/rsbuild-chain-types
Sep 7, 2026
Merged

fix: handle missing loader paths#84
chenjiahan merged 1 commit into
mainfrom
fix/rsbuild-chain-types

Conversation

@SoonIter

@SoonIter SoonIter commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

  • guard copied SWC/Babel loader paths before configuring the MDX rule
  • keep the existing loader options and runtime behavior when a loader is configured
  • restore compatibility with the stricter rspack-chain getter types exposed by Rsbuild

Validation

  • pnpm lint
  • pnpm check
  • pnpm build
  • pnpm test (5 passed)

Related: web-infra-dev/rsbuild#8437

Copilot AI lite review requested due to automatic review settings September 7, 2026 09:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T09:19:09.531161Z f904b24 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI 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.

🟢 Approval recommended

The change is small, well-scoped, and prevents a clear misconfiguration case (undefined loader path) without altering behavior when a loader is correctly configured.

Pull request overview

This PR updates the MDX plugin’s bundler-chain integration to avoid configuring the MDX rule with an undefined SWC/Babel loader path, improving compatibility with stricter Rsbuild/rspack-chain typings while preserving existing behavior when a loader is present.

Changes:

  • Guard SWC/Babel use.get('loader') before applying the loader to the MDX rule.
  • Only copy SWC/Babel loader + options into the MDX rule when a valid loader path is available.
File summaries
File Description
src/index.ts Adds a loader-path guard when copying SWC/Babel loader configuration into the MDX rule.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chenjiahan
chenjiahan merged commit 262a016 into main Sep 7, 2026
7 checks passed
@chenjiahan
chenjiahan deleted the fix/rsbuild-chain-types branch September 7, 2026 09:18
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.

3 participants