Lightning fast frontend tooling. Enjoy Hot Module Replacement (HMR), optimized builds, and seamless integration with React, Vue, or vanilla JS.
On-demand file serving over native ESM.
Updates code in the browser without reloading.
Use the CanxJS Vite plugin to manage entry points and reload behavior.
1// vite.config.ts2import { defineConfig } from 'vite';3import canx from 'canxjs/vite';4import react from '@vitejs/plugin-react';56export default defineConfig({7plugins: [8canx({9input: ['resources/css/app.css', 'resources/js/app.tsx'],10refresh: true,11}),12react(),13],14});
Use the <Vite /> component in your views to inject the correct script and style tags for both development (HMR) and production (hashed assets).
1<!-- src/views/app.tsx (JSX View) -->2import { Vite } from "canxjs";34export const AppLayout = ({ children }) => (5<html>6<head>7<title>My App</title>8{/* Auto-injects scripts and styles */}9<Vite entry={['resources/css/app.css', 'resources/js/app.tsx']} />10</head>11<body>12{children}13</body>14</html>15);
1// Run in development2bun run dev34// Build for production5bun run build