Skip to content

A vite plugin for importing Reason source code bundled with Melange

Notifications You must be signed in to change notification settings

Lavinium/vite-plugin-melange

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Melange Vite Plugin

A simple vite plugin for building and hot reloading Reason files

About

This plugin is for developers who compile Reason using dune build. When running npm run dev vite will spawn a dune process and when dune rerenders changed files, vite will reflect those changes in the browser.

Usage

Add the melangePlugin to vite config and

// vite.config.js
import melangePlugin from '@lavinium/vite-plugin-melange';

export default defineConfig({
    return {
        plugins: [
            melangePlugin({
                src: 'src',
                target: 'output',
            })
        ],
    };
});

Import the Reason file you wish to use in your main application file.

// app.js
import 'app/main.re'

example dune file

;; src/dune

(melange.emit
    (target output)
    ;; ...
)

Upgrading

Please see UPGRADING for details.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

A vite plugin for importing Reason source code bundled with Melange

Resources

Stars

Watchers

Forks

Packages

No packages published