This is a simple Vite plugin that starts rescript
(or rewatch
) at the beginning of the Vite pipeline.
It will ignore any ReScript files being watched by Vite.
This plugin is not published on npm; please fetch it from Git instead.
bun install -D @nojaf/vite-plugin-rescript
In your vite.config.js
:
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import rescript from "@nojaf/vite-plugin-rescript";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
rescript(),
react({
include: ["**/*.res.mjs"],
}),
]
});
To use rewatch
instead:
rescript({ useRewatch: true })
note: The plugin specifically looks for rewatch
in the rescript
package, so you need version 12 for this to work.
I prefer to start my dev server using a single command to avoid a split terminal setup.
(for maintainers)
bun publish --dry-run
bun publish --access=public