Tooling

Vite

Vite is the recommended build tool for new React projects. styled-components works with Vite out of the box, but adding a compiler plugin enables server-side rendering support, better debugging with component display names, and CSS minification.

The fastest setup uses the SWC-based React plugin with the styled-components SWC plugin:

npm install --save-dev @vitejs/plugin-react-swc @swc/plugin-styled-components
// vite.config.ts
import { defineConfig } from 'vite'