Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.
/ unplugin-rescript Public archive

a plugin for integration ReScript with most Bundler (Vite, Rollup, Webpack, Esbuild, etc).

License

Notifications You must be signed in to change notification settings

r17x/unplugin-rescript

Repository files navigation

a plugin for integration ReScript with most Bundler (Vite, Rollup, Webpack, Esbuild, etc).

🚧 Status: Work in progress (Unstable) - TODO" 🚧

Install

npm i unplugin-rescript
yarn add unplugin-rescript
pnpm add unplugin-rescript
bun add unplugin-rescript

Usage

Example: playground/

Vite
// vite.config.ts
import ReScript from 'unplugin-rescript/vite'

export default defineConfig({
  plugins: [
    ReScript(),
  ],
})


Farm
// farm.config.ts
import ReScript from 'unplugin-rescript/farm'

export default defineconfig({
  plugins: [
    ReScript(),
  ],
})


Rspack
// rspack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-rescript/rspack')()
  ]
}


Rollup
// rollup.config.js
import ReScript from 'unplugin-rescript/rollup'

export default {
  plugins: [
    ReScript(),
  ],
}


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-rescript/webpack')()
  ]
}


Esbuild
// esbuild.config.js
import { build } from 'esbuild'
import ReScript from 'unplugin-rescript/esbuild'

build({
  plugins: [ReScript()],
})


Astro
// astro.config.mjs
import { defineConfig } from 'astro/config'
import ReScript from 'unplugin-rescript/astro'

build({
  plugins: [ReScript()],
})


Compatibility

🔭 Troubleshooting

❤️ Credits

Inspired by