@@ -18,6 +18,7 @@ lastUpdated: false
1818- [ Rspack] ( https://www.rspack.dev/ )
1919- [ Rolldown] ( https://rolldown.rs/ )
2020- [ Farm] ( https://www.farmfe.org/ )
21+ - [ Bun] ( https://bun.com/ )
2122
2223## Trying It Online
2324
@@ -153,6 +154,21 @@ export default defineConfig({
153154})
154155```
155156
157+ ``` ts [Bun]
158+ // bun.config.ts
159+ import Starter from ' unplugin-starter/bun'
160+
161+ await Bun .build ({
162+ entrypoints: [' ./src/index.ts' ],
163+ outdir: ' ./dist' ,
164+ plugins: [
165+ Starter ({
166+ /* options */
167+ }),
168+ ],
169+ })
170+ ```
171+
156172``` js [Vue-CLI]
157173// vue.config.js
158174module .exports = {
@@ -193,18 +209,18 @@ export default defineConfig({
193209
194210## Supported Hooks
195211
196- | Hook | Rollup | Vite | webpack | esbuild | Rspack | Farm | Rolldown |
197- | --------------------------------------------------------------------------------- | :-------------: | :--: | :-----: | :-------------: | :-------------: | :--: | :------: |
198- | [ ` enforce ` ] ( https://vite.dev/guide/api-plugin.html#plugin-ordering ) | ❌ <sup >1</sup > | ✅ | ✅ | ❌ <sup >1</sup > | ✅ | ✅ | ✅ |
199- | [ ` buildStart ` ] ( https://rollupjs.org/plugin-development/#buildstart ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
200- | [ ` resolveId ` ] ( https://rollupjs.org/plugin-development/#resolveid ) | ✅ | ✅ | ✅ | ✅ | ✅ <sup >5</sup > | ✅ | ✅ |
201- | ~~ ` loadInclude ` ~~ <sup >2</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
202- | [ ` load ` ] ( https://rollupjs.org/plugin-development/#load ) | ✅ | ✅ | ✅ | ✅ <sup >3</sup > | ✅ | ✅ | ✅ |
203- | ~~ ` transformInclude ` ~~ <sup >2</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
204- | [ ` transform ` ] ( https://rollupjs.org/plugin-development/#transform ) | ✅ | ✅ | ✅ | ✅ <sup >3</sup > | ✅ | ✅ | ✅ |
205- | [ ` watchChange ` ] ( https://rollupjs.org/plugin-development/#watchchange ) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
206- | [ ` buildEnd ` ] ( https://rollupjs.org/plugin-development/#buildend ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
207- | [ ` writeBundle ` ] ( https://rollupjs.org/plugin-development/#writebundle ) <sup >4</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
212+ | Hook | Rollup | Vite | webpack | esbuild | Rspack | Farm | Rolldown | Bun |
213+ | --------------------------------------------------------------------------------- | :-------------: | :--: | :-----: | :-------------: | :-------------: | :--: | :------: | :-------------: |
214+ | [ ` enforce ` ] ( https://vite.dev/guide/api-plugin.html#plugin-ordering ) | ❌ <sup >1</sup > | ✅ | ✅ | ❌ <sup >1</sup > | ✅ | ✅ | ✅ | ❌ |
215+ | [ ` buildStart ` ] ( https://rollupjs.org/plugin-development/#buildstart ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
216+ | [ ` resolveId ` ] ( https://rollupjs.org/plugin-development/#resolveid ) | ✅ | ✅ | ✅ | ✅ | ✅ <sup >5</sup > | ✅ | ✅ | ✅ |
217+ | ~~ ` loadInclude ` ~~ <sup >2</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
218+ | [ ` load ` ] ( https://rollupjs.org/plugin-development/#load ) | ✅ | ✅ | ✅ | ✅ <sup >3</sup > | ✅ | ✅ | ✅ | ✅ |
219+ | ~~ ` transformInclude ` ~~ <sup >2</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
220+ | [ ` transform ` ] ( https://rollupjs.org/plugin-development/#transform ) | ✅ | ✅ | ✅ | ✅ <sup >3</sup > | ✅ | ✅ | ✅ | ✅ |
221+ | [ ` watchChange ` ] ( https://rollupjs.org/plugin-development/#watchchange ) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ |
222+ | [ ` buildEnd ` ] ( https://rollupjs.org/plugin-development/#buildend ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ < sup >6</ sup > |
223+ | [ ` writeBundle ` ] ( https://rollupjs.org/plugin-development/#writebundle ) <sup >4</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ < sup >6</ sup > |
208224
209225::: details Notice
210226
@@ -215,6 +231,7 @@ export default defineConfig({
2152313 . Although esbuild can handle both JavaScript and CSS and many other file formats, you can only return JavaScript in ` load ` and ` transform ` results.
2162324 . Currently, ` writeBundle ` is only serves as a hook for the timing. It doesn't pass any arguments.
2172335 . Rspack supports ` resolveId ` with a minimum required version of v1.0.0-alpha.1.
234+ 6 . Bun's plugin API doesn't have an ` onEnd ` hook yet, so ` buildEnd ` and ` writeBundle ` are not supported.
218235
219236:::
220237
@@ -253,6 +270,7 @@ export const webpackPlugin = unplugin.webpack
253270export const rspackPlugin = unplugin.rspack
254271export const esbuildPlugin = unplugin.esbuild
255272export const farmPlugin = unplugin.farm
273+ export const bunPlugin = unplugin.bun
256274```
257275
258276### Filters
@@ -289,14 +307,14 @@ More details can be found in the [Rolldown's documentation](https://rolldown.rs/
289307
290308## Supported Context
291309
292- | Context | Rollup | Vite | webpack | esbuild | Rspack | Farm | Rolldown |
293- | ------------------------------------------------------------------------------------- | :----: | :--: | :-----: | :-----: | :----: | :--: | :------: |
294- | [ ` this.parse ` ] ( https://rollupjs.org/plugin-development/#this-parse ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
295- | [ ` this.addWatchFile ` ] ( https://rollupjs.org/plugin-development/#this-addwatchfile ) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
296- | [ ` this.emitFile ` ] ( https://rollupjs.org/plugin-development/#this-emitfile ) <sup >1</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
297- | [ ` this.getWatchFiles ` ] ( https://rollupjs.org/plugin-development/#this-getwatchfiles ) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
298- | [ ` this.warn ` ] ( https://rollupjs.org/plugin-development/#this-warn ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
299- | [ ` this.error ` ] ( https://rollupjs.org/plugin-development/#this-error ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
310+ | Context | Rollup | Vite | webpack | esbuild | Rspack | Farm | Rolldown | Bun |
311+ | ------------------------------------------------------------------------------------- | :----: | :--: | :-----: | :-----: | :----: | :--: | :------: | :-: |
312+ | [ ` this.parse ` ] ( https://rollupjs.org/plugin-development/#this-parse ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
313+ | [ ` this.addWatchFile ` ] ( https://rollupjs.org/plugin-development/#this-addwatchfile ) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
314+ | [ ` this.emitFile ` ] ( https://rollupjs.org/plugin-development/#this-emitfile ) <sup >1</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
315+ | [ ` this.getWatchFiles ` ] ( https://rollupjs.org/plugin-development/#this-getwatchfiles ) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
316+ | [ ` this.warn ` ] ( https://rollupjs.org/plugin-development/#this-warn ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
317+ | [ ` this.error ` ] ( https://rollupjs.org/plugin-development/#this-error ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
300318
301319::: info Notice
302320
@@ -309,9 +327,9 @@ More details can be found in the [Rolldown's documentation](https://rolldown.rs/
309327
310328### Bundler Supported
311329
312- | Rollup | Vite | webpack | Rspack | esbuild | Farm | Rolldown |
313- | :--------------------: | :--: | :-----: | :----: | :-----: | :--: | :------: |
314- | ✅ ` >=3.1 ` <sup >1</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
330+ | Rollup | Vite | webpack | Rspack | esbuild | Farm | Rolldown | Bun |
331+ | :--------------------: | :--: | :-----: | :----: | :-----: | :--: | :------: | :-: |
332+ | ✅ ` >=3.1 ` <sup >1</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
315333
316334::: details Notice
317335
@@ -409,6 +427,9 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (
409427 farm: {
410428 // Farm plugin
411429 },
430+ bun: {
431+ // Bun plugin
432+ },
412433 }
413434}
414435
@@ -424,6 +445,7 @@ Each of the function takes the same generic factory argument as `createUnplugin`
424445
425446``` ts
426447import {
448+ createBunPlugin ,
427449 createEsbuildPlugin ,
428450 createFarmPlugin ,
429451 createRolldownPlugin ,
@@ -440,4 +462,5 @@ const esbuildPlugin = createEsbuildPlugin(/* factory */)
440462const webpackPlugin = createWebpackPlugin (/* factory */ )
441463const rspackPlugin = createRspackPlugin (/* factory */ )
442464const farmPlugin = createFarmPlugin (/* factory */ )
465+ const bunPlugin = createBunPlugin (/* factory */ )
443466```
0 commit comments