Skip to content

fix: handle optional CSS loader options - #88

Open
SoonIter wants to merge 1 commit into
mainfrom
fix/rsbuild-chain-types
Open

SoonIter wants to merge 1 commit into
mainfrom
fix/rsbuild-chain-types

Conversation

@SoonIter

@SoonIter SoonIter commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

  • type the copied CSS loader options through rspack-chain generic loader options
  • skip rules without configured CSS loader options
  • restore compatibility with the stricter rspack-chain getter types exposed by Rsbuild

Validation

  • pnpm lint
  • pnpm check
  • pnpm build
  • pnpm test (10 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:18:34.923073Z ad3fff1 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.

@SoonIter
SoonIter force-pushed the fix/rsbuild-chain-types branch from ad3fff1 to d952941 Compare September 7, 2026 09:18

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, locally contained, and correctly guards missing CSS loader options without introducing observable behavior regressions.

Pull request overview

This PR updates rsbuild-plugin-typed-css-modules to better handle cases where the CSS loader has no configured options, while keeping compatibility with stricter rspack-chain typing exposed by Rsbuild.

Changes:

  • Type the CSS loader usage via rule.use<CSSLoaderOptions>(...) to align with the chain’s generic loader option typing.
  • Treat missing CSS loader options as a “skip this rule” case by guarding access to modules with optional chaining.
File summaries
File Description
src/index.ts Makes CSS loader option retrieval safer/typed and skips rules when CSS loader options (or modules) are not configured.
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.

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