Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/r17x/unplugin-rescript

a plugin for integration ReScript with most Bundler (Vite, Rollup, Webpack, Esbuild, etc).
https://github.com/r17x/unplugin-rescript

astro farm rescript rolldown rollup rspack unplugin vite webpack

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        


[MOVE HERE]unplugin-rescript



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



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




## Install

```bash
npm i unplugin-rescript
```

```bash
yarn add unplugin-rescript
```

```bash
pnpm add unplugin-rescript
```

```bash
bun add unplugin-rescript
```

## Usage

> Example: [`playground/`](./playground/)

Vite

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

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

Farm

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

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

Rspack

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

Rollup

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

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


Webpack

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


Esbuild

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

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


Astro

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

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


## Compatibility

## 🔭 Troubleshooting

## ❤️ Credits

Inspired by

* [jihchi/vite-plugin-rescript](https://github.com/jihchi/vite-plugin-rescript) - [@jihchi](https://github.com/jihchi)
* [unplugin/unplugin-starter](https://github.com/unplugin/unplugin-starter) - [@antfu](https://github.com/antfu)