Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 69 additions & 81 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion rsbuild/stylex/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Rsbuild Project
# Rsbuild + StyleX

Minimal example of using [StyleX](https://stylexjs.com/) with Rsbuild via the official [`@stylexjs/unplugin`](https://stylexjs.com/docs/learn/installation/rspack/) adapter.

The plugin compiles StyleX at build time and appends the generated CSS to the stylesheet emitted by Rsbuild's `CssExtractRspackPlugin` (fed by `src/index.css`). StyleX styles therefore stay in the normal CSS asset pipeline with content-hashed filenames, instead of a separate hardcoded `/stylex.css` link.

This example uses `stylex.webpack()` (not `stylex.rspack()`) because `@stylexjs/unplugin` currently attaches CSS injection through the webpack-compatible hook; Rspack still runs that hook for plugins registered via `tools.rspack.plugins`.

## Setup

Expand Down
Loading
Loading