https://github.com/dwlad90/stylex-swc-plugin
Community NAPI-RS/SWC plugin for StyleX.
https://github.com/dwlad90/stylex-swc-plugin
nextjs rust stylex swc-plugin webpack
Last synced: 7 months ago
JSON representation
Community NAPI-RS/SWC plugin for StyleX.
- Host: GitHub
- URL: https://github.com/dwlad90/stylex-swc-plugin
- Owner: Dwlad90
- License: mit
- Created: 2024-04-26T19:28:02.000Z (over 1 year ago)
- Default Branch: develop
- Last Pushed: 2024-12-28T17:26:16.000Z (10 months ago)
- Last Synced: 2024-12-30T09:46:40.745Z (10 months ago)
- Topics: nextjs, rust, stylex, swc-plugin, webpack
- Language: Rust
- Homepage:
- Size: 5.97 MB
- Stars: 57
- Watchers: 6
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# StyleX in Rust · [](https://github.com/Dwlad90/stylex-swc-plugin/blob/develop/LICENSE) [](https://www.npmjs.com/package/@stylexswc/rs-compiler)  
This is a monorepo for an unofficial [`napi-rs`](https://napi.rs/) compiler and
an [SWC](https://swc.rs/) plugin for
[StyleX](https://github.com/facebook/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](https://nextjs.org/docs/architecture/nextjs-compiler).## Project Structure
This project is organized into several packages:
**Core:**
- [`rs-compiler`](./crates/stylex-rs-compiler) - Rust-based
[`napi-rs`](https://napi.rs/) compiler for transforming StyleX code.**Integration:**
- [`nextjs-plugin`](./packages/nextjs-plugin) - A wrapper for
[`Next.JS configuration`](https://nextjs.org/docs/app/api-reference/next-config-js)
that integrates the StyleX [napi-rs](https://napi.rs/) compiler into the
Webpack processing pipeline.- [`webpack-plugin`](./packages/webpack-plugin) - A `Webpack pluign` that
integrates the StyleX [napi-rs](https://napi.rs/) compiler.- [`rollup-plugin`](./packages/rollup-plugin) - A `Rollup plugin` that
integrates the StyleX [napi-rs](https://napi.rs/) compiler.- [`unplugin`](./packages/unplugin) - Plugin collection for various build tools
that integrates the StyleX [napi-rs](https://napi.rs/) compiler.Supported build tools and libraries:
- Farm
- Rollup
- Rsbuild
- Rspack
- Solid
- Vite
- Vue
- Webpack- [`postcss-plugin`](./packages/postcss-plugin) - A `PostCSS plugin` that
integrates the StyleX [napi-rs](https://napi.rs/) compiler.- [`jest`](./packages/jest) - Jest transformer that integrates the StyleX
[napi-rs](https://napi.rs/) compiler.**Utilities:**
- [`stylex-shared`](./crates/stylex-shared) - Shared Rust codebase for the
StyleX RS compiler and SWC plugin.- [`path-resolver`](./crates/stylex-path-resolver) - Path handling and resolving
utilities for the StyleX NAPI-RS/SWC plugin.- [`test-parser`](./crates/stylex-test-parser) - Parser for
[StyleX](https://github.com/facebook/stylex) repo Jest tests that helps to
understand last changes and keeps the project up to date**Internal Configurations:**
- [`eslint-config`](./packages/eslint-config) - Internal
[ESLint](https://eslint.org/) configuration- [`typescript-config`](./packages/typescript-config) - Internal
[Typescript](https://www.typescriptlang.org/docs/handbook/tsconfig-json.htm)
configuration**Other packages:**
- [`design-system`](./packages/design-system) - Design system for the StyleX
project, intended solely for internal use with in-workspace examples to
support consistent UI experimentation and prototyping.- [`playwright`](./packages/playwright) - Playwright integration for StyleX
visual regression testing.