Vite plugin for @compiled/react, a CSS-in-JS library from Atlassian Labs. v1.3.1, actively maintained. Integrates Compiled's static extraction with Vite's build and dev server. Supports per-environment CSS extraction (build/serve) and PostCSS config. Unlike runtime CSS-in-JS, Compiled extracts styles at build time for zero runtime overhead. Requires @compiled/react, vite, and @vitejs/plugin-react as peer dependencies. Ships TypeScript types.
npm install vite-plugin-compiled-reactVerified import paths — ran on the pinned version, not inferred.
Minimal Vite config enabling Compiled with CSS extraction for both build and serve.
Order plugins: [react(), compiled(...)] not [compiled(...), react()]
Disable extraction in dev: compiled({ extract: { build: true, serve: false } })npm install --save-dev vite-plugin-compiled-react
import { compiled } from 'vite-plugin-compiled-react'