⚠️ EXPERIMENTAL
You probably shouldn't use this unless you're me.
A tiny helper to configure SSR for Stitches in Vite ✨
-
Install the package via your favourite package manager:
npm i vite-plugin-stitches
-
Export
getCssString
from you Stitches config// your-stitches-config import { createCss } from "@stitches/core"; export const { getCssString } = createCss({ // your config });
-
Import your
getCssString
intovite.config.js
and add toViteStitches()
:Note: in it's current iteration,
vite-plugin-stitches
doesn't transpile ts/esm files for you. You'll need to do this manuallyimport { getCssString } from "your-stitches-config"; import ViteStitches from "vite-plugin-stitches"; export default defineConfig({ plugins: [ViteStitches({ getCssString })], });