An unofficial Vite plugin for integrating Stylex, a CSS-in-JS library from Meta. Version 0.8.0 is the current stable release, updated regularly on GitHub. This plugin provides HMR support, CSS automatic injection (via virtual module), and customization through babelConfig and CSS order control. It differs from other Stylex integrations by being Vite-specific and offering manual CSS ordering, making it suitable for SSR frameworks. It requires Stylex as a peer dependency and is ESM-only, targeting modern development workflows.
npm install vite-plugin-stylex-devVerified import paths — ran on the pinned version, not inferred.
Sets up the vite-plugin-stylex-dev plugin in Vite config and imports the virtual CSS module in the entry file for automatic style injection.
Pin exact version and read migration notes in the repo.
Monitor the Stylex documentation for official module resolution support.
Use ESM import syntax: import { stylex } from 'vite-plugin-stylex-dev'.Add import 'virtual:stylex.css' in your entry file or set manuallyControlCssOrder: true.
Disable competing CSS modules or PostCSS config if conflicts arise.
Ensure the package is installed: npm install -D vite-plugin-stylex-dev. Add 'vite-plugin-stylex-dev' to 'types' in tsconfig.json if needed.
Use import { stylex } from 'vite-plugin-stylex-dev' (curly braces).Set 'type': 'module' in package.json or use .mjs extension for Vite config.