Skip to content

fix: handle missing loader paths - #15

Merged
chenjiahan merged 1 commit into
rstackjs:mainfrom
SoonIter:fix/rsbuild-chain-types
Sep 8, 2026
Merged

chenjiahan merged 1 commit into
rstackjs:mainfrom
SoonIter:fix/rsbuild-chain-types

Conversation

@SoonIter

@SoonIter SoonIter commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

  • guard copied CSS loader paths before configuring Stylus rules
  • keep existing loader options and cloned options for configured loaders
  • restore compatibility with the stricter rspack-chain getter types exposed by Rsbuild

Validation

  • pnpm lint
  • pnpm check
  • pnpm build
  • pnpm test (9 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:02.530994Z 85b4267 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, localized, and defensively handles missing loader paths without altering the existing options-cloning behavior.

Pull request overview

This PR improves the Stylus plugin’s bundler-chain integration by guarding against missing CSS loader paths when cloning Rsbuild’s built-in CSS loader chain into Stylus rules, maintaining compatibility with stricter rspack-chain getter typings.

Changes:

  • Skip copying a CSS use entry when its loader path is missing (avoids configuring an invalid loader).
  • Preserve existing loader options by continuing to deep-clone and re-apply the copied loader options.
  • Use the cached loaderPath when configuring the cloned loader entry.
File summaries
File Description
src/index.ts Adds a guard for missing loader paths and uses the cached path when cloning CSS loader uses into Stylus rules.
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 fca1d2e into rstackjs:main Sep 8, 2026
3 checks passed
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