JS+ 🧡 SvelteKit
Prerequisites
Section titled “Prerequisites”- A text editor • VS Code with JS+ extension
- Node.js • >=24
- A package manager
- TypeScript installed in your project • >=5.9.3
- SvelteKit installed in your project • >=1.0.0
-
Install the necessary dependencies
Terminal window pnpm i -D @jsplang/jsp @jsplang/vite-plugin-jspTerminal window bun i -D @jsplang/jsp @jsplang/vite-plugin-jspTerminal window npm i -D @jsplang/jsp @jsplang/vite-plugin-jsp -
Add the JS+ plugin to your
vite.config.jsimport jsp from '@jsplang/vite-plugin-jsp';import { defineConfig } from 'vite';// https://vite.dev/config/export default defineConfig({plugins: [jsp()],}); -
Add the JS+ preprocessor to your
svelte.config.jsimport jsp from '@jsplang/svelte-preprocess-jsp';import adapter from '@sveltejs/adapter-auto';/** @type {import('@sveltejs/kit').Config} */const config = {kit: {// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.// If your environment is not supported, or you settled on a specific environment, switch out the adapter.// See https://svelte.dev/docs/kit/adapters for more information about adapters.adapter: adapter(),},preprocess: [jsp()],};export default config; -
Run the development server
Terminal window pnpm devTerminal window bun devTerminal window npm run dev -
Done!