Registry / web-framework / vite-plugin-compiled-react

vite-plugin-compiled-react

JSON →
library1.3.1jsnpmunverified

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-react
INSTALL
IMPORT
SIG · VITE-PLUGIN-COMPIL
V
vite-plugin-compiled-react
web-frameworkjavascriptv1.3.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compiled
import { compiled } from 'vite-plugin-compiled-react'
import compiled from 'vite-plugin-compiled-react'
Named export, not default. TypeScript supported out-of-box.

Minimal Vite config enabling Compiled with CSS extraction for both build and serve.

import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { compiled } from 'vite-plugin-compiled-react'; export default defineConfig({ plugins: [ react(), compiled({ extract: true }) ] });
Debug
Known issues
gotchaThe @vitejs/plugin-react plugin must be added before the compiled plugin in the plugins array.
fix
Order plugins: [react(), compiled(...)] not [compiled(...), react()]
affects: *
gotchaCSS extraction may not work with all SSR frameworks in development mode due to preloading differences.
fix
Disable extraction in dev: compiled({ extract: { build: true, serve: false } })
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'vite-plugin-compiled-react'
Package not installed or missing from dependencies.
fix
npm install --save-dev vite-plugin-compiled-react
TypeError: compiled is not a function
Default import used instead of named import.
fix
import { compiled } from 'vite-plugin-compiled-react'
Upgrade
Version history
1.3.1latest on npm
Audit
Dependencies
@compiled/reactrequiredCore Compiled library for CSS-in-JS
viterequiredVite build tool peer dependency
@vitejs/plugin-reactrequiredRequired Vite React plugin (must be added before compiled plugin)
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
vite-plugin-compiled-react — npm install vite-plugin-compiled-react · libregistry