Skip to content

JS+ 🧡 Svelte

  1. Install the necessary dependencies

    Terminal window
    pnpm i -D @jsplang/jsp @jsplang/vite-plugin-jsp @jsplang/svelte-preprocess-jsp
  2. Add the JS+ plugin to your vite.config.js

    import jsp from '@jsplang/vite-plugin-jsp';
    import { defineConfig } from 'vite';
    // https://vite.dev/config/
    export default defineConfig({
    plugins: [jsp()],
    });
  3. Add the JS+ preprocessor to your svelte.config.js

    import jsp from '@jsplang/svelte-preprocess-jsp';
    import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
    /** @type {import("@sveltejs/vite-plugin-svelte").SvelteConfig} */
    export default {
    preprocess: [
    jsp(),
    vitePreprocess()
    ],
    };
  4. Run the development server

    Terminal window
    pnpm dev
  5. Done!