@@ -16,6 +16,7 @@ lastUpdated: false
1616- [ webpack] ( https://webpack.js.org/ )
1717- [ esbuild] ( https://esbuild.github.io/ )
1818- [ Rspack] ( https://www.rspack.dev/ )
19+ - [ Rsbuild] ( https://rsbuild.rs/ )
1920- [ Rolldown] ( https://rolldown.rs/ )
2021- [ Farm] ( https://www.farmfe.org/ )
2122- [ Bun] ( https://bun.com/ )
@@ -131,6 +132,20 @@ module.exports = {
131132}
132133```
133134
135+ ``` ts [Rsbuild]
136+ // rsbuild.config.ts
137+ import { defineConfig } from ' @rsbuild/core'
138+ import Starter from ' unplugin-starter/rsbuild'
139+
140+ export default defineConfig ({
141+ plugins: [
142+ Starter ({
143+ /* options */
144+ }),
145+ ],
146+ })
147+ ```
148+
134149``` js [esbuild]
135150// esbuild.config.js
136151import { build } from ' esbuild'
@@ -209,18 +224,18 @@ export default defineConfig({
209224
210225## Supported Hooks
211226
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 > |
227+ | Hook | Rollup | Vite | webpack | esbuild | Rspack | Rsbuild | Farm | Rolldown | Bun |
228+ | --------------------------------------------------------------------------------- | :-------------: | :--: | :-----: | :-------------: | :-------------: | :-------------: | :-- : | :------: | :-------------: |
229+ | [ ` enforce ` ] ( https://vite.dev/guide/api-plugin.html#plugin-ordering ) | ❌ <sup >1</sup > | ✅ | ✅ | ❌ <sup >1</sup > | ✅ | ✅ | ✅ | ✅ | ❌ |
230+ | [ ` buildStart ` ] ( https://rollupjs.org/plugin-development/#buildstart ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
231+ | [ ` resolveId ` ] ( https://rollupjs.org/plugin-development/#resolveid ) | ✅ | ✅ | ✅ | ✅ | ✅ <sup >5</sup > | ✅ < sup >5</ sup > | ✅ | ✅ | ✅ |
232+ | ~~ ` loadInclude ` ~~ <sup >2</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
233+ | [ ` load ` ] ( https://rollupjs.org/plugin-development/#load ) | ✅ | ✅ | ✅ | ✅ <sup >3</sup > | ✅ | ✅ | ✅ | ✅ | ✅ |
234+ | ~~ ` transformInclude ` ~~ <sup >2</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
235+ | [ ` transform ` ] ( https://rollupjs.org/plugin-development/#transform ) | ✅ | ✅ | ✅ | ✅ <sup >3</sup > | ✅ | ✅ | ✅ | ✅ | ✅ |
236+ | [ ` watchChange ` ] ( https://rollupjs.org/plugin-development/#watchchange ) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
237+ | [ ` buildEnd ` ] ( https://rollupjs.org/plugin-development/#buildend ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ <sup >6</sup > |
238+ | [ ` writeBundle ` ] ( https://rollupjs.org/plugin-development/#writebundle ) <sup >4</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ <sup >6</sup > |
224239
225240::: details Notice
226241
@@ -230,7 +245,7 @@ export default defineConfig({
230245 In Rollup, this hook has been polyfilled to match the behaviors. See the following usage examples for reference.
2312463 . Although esbuild can handle both JavaScript and CSS and many other file formats, you can only return JavaScript in ` load ` and ` transform ` results.
2322474 . Currently, ` writeBundle ` is only serves as a hook for the timing. It doesn't pass any arguments.
233- 5 . Rspack supports ` resolveId ` with a minimum required version of v1.0.0-alpha.1.
248+ 5 . Rspack and Rsbuild support ` resolveId ` with a minimum required Rspack version of v1.0.0-alpha.1.
2342496 . Bun supports ` buildEnd ` and ` writeBundle ` with a minimum required version of v1.3.0.
235250
236251:::
@@ -268,6 +283,7 @@ export const rollupPlugin = unplugin.rollup
268283export const rolldownPlugin = unplugin.rolldown
269284export const webpackPlugin = unplugin.webpack
270285export const rspackPlugin = unplugin.rspack
286+ export const rsbuildPlugin = unplugin.rsbuild
271287export const esbuildPlugin = unplugin.esbuild
272288export const farmPlugin = unplugin.farm
273289export const bunPlugin = unplugin.bun
@@ -307,14 +323,14 @@ More details can be found in the [Rolldown's documentation](https://rolldown.rs/
307323
308324## Supported Context
309325
310- | Context | Rollup | Vite | webpack | esbuild | Rspack | Farm | Rolldown | Bun |
311- | ------------------------------------------------------------------------------------- | :----: | :--: | :-----: | :-----: | :----: | :--: | :------: | :-: |
312- | [ ` this.parse ` ] ( https://rollupjs.org/plugin-development/#this-parse ) <sup >1</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
313- | [ ` this.addWatchFile ` ] ( https://rollupjs.org/plugin-development/#this-addwatchfile ) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
314- | [ ` this.emitFile ` ] ( https://rollupjs.org/plugin-development/#this-emitfile ) <sup >2</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 ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
326+ | Context | Rollup | Vite | webpack | esbuild | Rspack | Rsbuild | Farm | Rolldown | Bun |
327+ | ------------------------------------------------------------------------------------- | :----: | :--: | :-----: | :-----: | :----: | :-----: | :-- : | :------: | :-: |
328+ | [ ` this.parse ` ] ( https://rollupjs.org/plugin-development/#this-parse ) <sup >1</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
329+ | [ ` this.addWatchFile ` ] ( https://rollupjs.org/plugin-development/#this-addwatchfile ) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
330+ | [ ` this.emitFile ` ] ( https://rollupjs.org/plugin-development/#this-emitfile ) <sup >2</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
331+ | [ ` this.getWatchFiles ` ] ( https://rollupjs.org/plugin-development/#this-getwatchfiles ) | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
332+ | [ ` this.warn ` ] ( https://rollupjs.org/plugin-development/#this-warn ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
333+ | [ ` this.error ` ] ( https://rollupjs.org/plugin-development/#this-error ) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
318334
319335::: info Notice
320336
@@ -329,9 +345,9 @@ More details can be found in the [Rolldown's documentation](https://rolldown.rs/
329345
330346### Bundler Supported
331347
332- | Rollup | Vite | webpack | Rspack | esbuild | Farm | Rolldown | Bun |
333- | :--------------------: | :--: | :-----: | :----: | :-----: | :--: | :------: | :-: |
334- | ✅ ` >=3.1 ` <sup >1</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
348+ | Rollup | Vite | webpack | Rspack | Rsbuild | esbuild | Farm | Rolldown | Bun |
349+ | :--------------------: | :--: | :-----: | :----: | :-----: | :-----: | :-- : | :------: | :-: |
350+ | ✅ ` >=3.1 ` <sup >1</sup > | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
335351
336352::: details Notice
337353
@@ -386,7 +402,7 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (
386402 options ,
387403 meta ,
388404) => {
389- console .log (meta .framework ) // vite | rollup | webpack | esbuild | rspack | farm | bun
405+ console .log (meta .framework ) // vite | rollup | webpack | esbuild | rspack | rsbuild | farm | bun
390406
391407 return {
392408 name: ' unplugin-starter' ,
@@ -417,6 +433,12 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (
417433 rspack(compiler ) {
418434 // Configure Rspack compiler
419435 },
436+ rsbuild: {
437+ // Rsbuild plugin
438+ setup(api ) {
439+ // Configure Rsbuild
440+ },
441+ },
420442 esbuild: {
421443 // Change the filter of onResolve and onLoad
422444 // onResolveFilter?: RegExp,
@@ -464,19 +486,26 @@ export const unpluginFactory = defineUnplugin((options, meta) => {
464486 const bundlerVersion = meta .versions .rollup ?? meta .versions .rolldown
465487 console .log (` Vite is using bundler version: ${bundlerVersion } ` )
466488 }
489+
490+ // For Rsbuild, you can also access the underlying Rspack version
491+ if (meta .framework === ' rsbuild' ) {
492+ const rspackVersion = meta .versions .rspack
493+ console .log (` Rsbuild is using Rspack version: ${rspackVersion } ` )
494+ }
467495 }
468496 }
469497})
470498```
471499
472- | Rollup | Vite | webpack | Rspack | esbuild | Farm | Rolldown | Unloader | Bun |
473- | :------------: | :--------------: | :-----: | :----: | :-----: | :--: | :------------: | :------------: | :-: |
474- | ✅<sup >1</sup > | ✅<sup >1,2</sup > | ✅ | ✅ | ❌ | ❌ | ✅<sup >1</sup > | ✅<sup >1</sup > | ✅ |
500+ | Rollup | Vite | webpack | Rspack | Rsbuild | esbuild | Farm | Rolldown | Unloader | Bun |
501+ | :------------: | :--------------: | :-----: | :----: | :------------: | :----- : | :--: | :------------: | :------------: | :-: |
502+ | ✅<sup >1</sup > | ✅<sup >1,2</sup > | ✅ | ✅ | ✅< sup >3</ sup > | ❌ | ❌ | ✅<sup >1</sup > | ✅<sup >1</sup > | ✅ |
475503
476504::: details Notice
477505
4785061 . For Rollup-compatible hosts (` vite ` , ` rollup ` , ` rolldown ` , ` unloader ` ), framework versions are only available after the ` buildStart ` hook. The ` unplugin ` version is always available.
4795072 . Vite requires ** v7.0.0 or later** to provide ` viteVersion ` ([ vitejs/vite #20088 ] ( https://github.com/vitejs/vite/pull/20088 ) ). On earlier versions, ` meta.versions.vite ` will be ` undefined ` . Vite also provides the underlying bundler version (` rollup ` or ` rolldown ` ).
508+ 3 . Rsbuild also provides the underlying Rspack version via ` meta.versions.rspack ` .
480509
481510:::
482511
@@ -492,6 +521,7 @@ import {
492521 createFarmPlugin ,
493522 createRolldownPlugin ,
494523 createRollupPlugin ,
524+ createRsbuildPlugin ,
495525 createRspackPlugin ,
496526 createVitePlugin ,
497527 createWebpackPlugin ,
@@ -503,6 +533,7 @@ const rolldownPlugin = createRolldownPlugin(/* factory */)
503533const esbuildPlugin = createEsbuildPlugin (/* factory */ )
504534const webpackPlugin = createWebpackPlugin (/* factory */ )
505535const rspackPlugin = createRspackPlugin (/* factory */ )
536+ const rsbuildPlugin = createRsbuildPlugin (/* factory */ )
506537const farmPlugin = createFarmPlugin (/* factory */ )
507538const bunPlugin = createBunPlugin (/* factory */ )
508539```
0 commit comments