@nojaf/vite-plugin-rescript

0.2.0 • Public • Published

NPM Version

vite-plugin-rescript

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.

Install

This plugin is not published on npm; please fetch it from Git instead.

bun install -D @nojaf/vite-plugin-rescript

Configuration

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.

Why

I prefer to start my dev server using a single command to avoid a split terminal setup.

Publish

(for maintainers)

bun publish --dry-run
bun publish  --access=public

Package Sidebar

Install

npm i @nojaf/vite-plugin-rescript

Weekly Downloads

11

Version

0.2.0

License

MIT

Unpacked Size

17.4 kB

Total Files

4

Last publish

Collaborators

  • nojaf