A starter template for CxJS with Vite, TypeScript, and Tailwind CSS.
npm install
npm run devnpm run dev- Start development server with HMRnpm run build- Build for productionnpm run preview- Preview production build
CxJS uses a custom JSX transform. Configure tsconfig.json:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "cx",
"module": "es2022",
"moduleResolution": "bundler",
"esModuleInterop": true
}
}For HMR to work correctly with CxJS, add this at the end of your entry file:
if (import.meta.hot) import.meta.hot.accept();Tailwind is configured via @tailwindcss/vite plugin. Import it in a CSS file:
@import "tailwindcss";