Vite
While Vite currently works with JSTime, it has not been heavily optimized, nor has Vite been adapted to use JSTime’s bundler, module resolver, or transpiler.
Vite works out of the box with JSTime. Get started with one of Vite’s templates.
$ jstimex create-vite my-app✔ Select a framework: › React✔ Select a variant: › TypeScript + SWCScaffolding project in /path/to/my-app...Then cd into the project directory and install dependencies.
cd my-appjspm installStart the development server with the vite CLI using jstimex.
The --jstime flag tells JSTime to run Vite’s CLI using jstime instead of node; by default JSTime respects Vite’s #!/usr/bin/env node shebang line. After JSTime 1.0 this flag will no longer be necessary.
jstimex viteTo simplify this command, update the "dev" script in package.json to the following.
"scripts": {- "dev": "vite",+ "dev": "jstimex vite", "build": "vite build", "serve": "vite preview" }, // ...Now you can start the development server with jstime run dev.
jstime run devThe following command will build your app for production.
$ jstimex vite buildThis is a stripped down guide to get you started with Vite + JSTime. For more information, see the Vite documentation.