This is a monorepo for an unofficial napi-rs
compiler and
an SWC plugin for
StyleX. Using SWC allows us to completely
ditch Babel and make StyleX faster.
Key Benefits:
- Faster build times by leveraging NAPI-RS/SWC instead of Babel.
- Seamless integration with Next.js SWC Compiler.
- Almost 100% compatibility with official StyleX tests.
This is specifically useful for Next.js projets as it allows us to use SWC Next.js Compiler.
This project is organized into several packages:
Core:
rs-compiler
- Rust-basednapi-rs
compiler for transforming StyleX code.
Integration:
-
nextjs-plugin
- A wrapper forNext.JS configuration
that integrates the StyleX napi-rs compiler into the Webpack processing pipeline. -
webpack-plugin
- AWebpack pluign
that integrates the StyleX napi-rs compiler. -
rollup-plugin
- ARollup plugin
that integrates the StyleX napi-rs compiler. -
unplugin
- Plugin collection for various build tools that integrates the StyleX napi-rs compiler.Supported build tools and libraries:
- Farm
- Rollup
- Rsbuild
- Rspack
- Solid
- Vite
- Vue
- Webpack
Utilities:
-
stylex-shared
- Shared Rust codebase for the StyleX RS compiler and SWC plugin. -
path-resolver
- Path handling and resolving utilities for the StyleX NAPI-RS / SWC plugin. -
test-parser
- Parser for StyleX repo Jest tests that helps to understand last changes and keeps the project up to date
Internal Configurations:
-
eslint-config
- Internal ESLint configuration -
typescript-config
- Internal Typescript configuration
Warning
The packages below are deprecated as of version 0.3.0
and may be removed in the future. Please use the newer alternatives listed above.
Core:
swc-plugin
- Unofficial SWC implementation of the native StyleX plugin. The new alternative isrs-compiler
Integration:
nextjs-swc-plugin
- Wrapper forNext.JS config
that inject the StyleX SWC plugin to webpack processing. The new alternative isnextjs-plugin