a plugin for integration ReScript with most Bundler (Vite, Rollup, Webpack, Esbuild, etc).
🚧 Status: Work in progress (Unstable) - TODO" 🚧
npm i unplugin-rescript
yarn add unplugin-rescript
pnpm add unplugin-rescript
bun add unplugin-rescript
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()],
})
Inspired by