3.9.0 • Published 9 months ago

vite-plugin-melange v3.9.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

vite-plugin-melange

A Vite plugin for Melange.

Features

  • Compile Melange source files as part of the build
  • Show errors on the commandline and in the browser overlay
  • HMR (hot module replacement) with Melange source filenames as module names

Usage

npm install --save-dev vite-plugin-melange

vite.config.js:

import { defineConfig } from "vite";
import melangePlugin from "vite-plugin-melange";

export default defineConfig({
  plugins: [
    melangePlugin({
      buildCommand: "opam exec -- dune build",
      watchCommand: "opam exec -- dune build --watch",
    }),
  ]
});

Options

  • buildCommand: (required) Dune build command. For instance: opam exec -- dune build
  • watchCommand: (required) Dune watch command. For instance: opam exec -- dune build --watch
  • buildContext: (default: "default") Dune build context. The default corresponds to Dune's default
  • emitDir: (default: ".") Directory (relative to Vite root) where the melange.emit stanza is located. It defaults to the current directory, which is the recommended location
  • buildTarget: (default: "output") target field of the melange.emit stanza. It defines the directory where the JavaScript artifacts will be placed
  • duneDir: (default: ".") Directory (relative to Vite root) where Dune is running (can be used for instance if dune-project is in the parent directory). You may also need to add it to server.fs.allow.

Build

npm install
npm run build
3.9.0

9 months ago

3.8.0

9 months ago

2.4.0

1 year ago

3.4.0

1 year ago

3.3.0

1 year ago

3.2.0

1 year ago

3.1.0

1 year ago

3.7.1

12 months ago

3.7.0

1 year ago

3.6.0

1 year ago

3.5.0

1 year ago

3.0.0

1 year ago

2.3.0

2 years ago

2.2.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago