vite-plugin-compiled-react
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

vite-plugin-compiled-react

Vite plugin for https://github.com/atlassian-labs/compiled

PostCSS config is supported when extraction is enabled.
CSS extraction can be enabled for build and serve separately.
extract: { build: true, serve: true }
or a shorthand extract: true

Your SSR framework may not support preloading extracted CSS in development mode.

Usage:

npm i @compiled/react
npm i -D vite-plugin-compiled-react
import { compiled } from "vite-plugin-compiled-react";

export default defineConfig({
  plugins: [react(), compiled({ extract: true })],
});
const Component = () => (
  <div
    css={{
      color: "red",
      ":hover": {
        color: "blue",
      },
    }}
  >
   Hello
  </div>
);

Typescript should work out of the box.

Readme

Keywords

Package Sidebar

Install

npm i vite-plugin-compiled-react

Weekly Downloads

131

Version

1.1.3

License

MIT

Unpacked Size

7.78 kB

Total Files

4

Last publish

Collaborators

  • nitedani