Skip to content

codaxy/cxjs-vite-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CxJS + Vite

A starter template for CxJS with Vite, TypeScript, and Tailwind CSS.

Setup

npm install
npm run dev

Scripts

  • npm run dev - Start development server with HMR
  • npm run build - Build for production
  • npm run preview - Preview production build

TypeScript Configuration

CxJS uses a custom JSX transform. Configure tsconfig.json:

{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "cx",
    "module": "es2022",
    "moduleResolution": "bundler",
    "esModuleInterop": true
  }
}

Hot Module Replacement

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 CSS

Tailwind is configured via @tailwindcss/vite plugin. Import it in a CSS file:

@import "tailwindcss";

About

Minimal CxJS application powered by Vite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published