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-rscompiler for transforming StyleX code.
Integration:
-
nextjs-plugin- A wrapper forNext.JS configurationthat integrates the StyleX napi-rs compiler into the Webpack processing pipeline. -
webpack-plugin- AWebpack pluignthat integrates the StyleX napi-rs compiler. -
rollup-plugin- ARollup pluginthat 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
-
postcss-plugin- APostCSS pluginthat integrates the StyleX napi-rs compiler. -
jest- Jest transformer that integrates the StyleX napi-rs compiler.
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
Other packages:
design-system- Design system for the StyleX project that uses in workspace examples