Integrates StyleX CSS-in-JS library with Vite build tool. Current version 0.13.0 supports StyleX 0.9.3, Vite ^5.2.7. Active development with monthly releases. Differentiates by leveraging Vite's CSS pipeline for minification and post-processing, supporting LightningCSS, CSS layers, and automatic style generation. Requires manual Vite configuration unlike some auto-setup CSS-in-JS solutions.
npm install vite-plugin-stylexVerified import paths — ran on the pinned version, not inferred.
Minimal Vite config with vite-plugin-stylex showing common options: CSS layers, StyleX imports, and module resolution for CommonJS compatibility.
Upgrade to Vite ^5.2.7 and plugin >=0.9.0.
Ensure Vite's CSS handling is not disabled; CSS minification and post-processing are now Vite-controlled.
Use @/_ or @src/_ instead of @\_ or @src\_ in path aliases.
May cause delay in style generation; update Vite if API changes.
Monitor release notes for stable API replacements.
npm install @stylexjs/stylex
Use `import vitePluginStylex from 'vite-plugin-stylex'` (no braces)
Ensure plugin is included in the `plugins` array: `plugins: [vitePluginStylex()]`
Upgrade to Vite ^5.2.7