Title: feat: add first-class Rsbuild adapter · Issue #607 · unjs/unplugin · GitHub
Open Graph Title: feat: add first-class Rsbuild adapter · Issue #607 · unjs/unplugin
X Title: feat: add first-class Rsbuild adapter · Issue #607 · unjs/unplugin
Description: Describe the feature unplugin@3.0.0 provides first-class adapters for Vite, Webpack, Rollup, esbuild, and Rspack, but it does not currently expose a first-class Rsbuild adapter. Specifically, there is no: createRsbuildPlugin(factory) cre...
Open Graph Description: Describe the feature unplugin@3.0.0 provides first-class adapters for Vite, Webpack, Rollup, esbuild, and Rspack, but it does not currently expose a first-class Rsbuild adapter. Specifically, there...
X Description: Describe the feature unplugin@3.0.0 provides first-class adapters for Vite, Webpack, Rollup, esbuild, and Rspack, but it does not currently expose a first-class Rsbuild adapter. Specifically, there...
Opengraph URL: https://github.com/unjs/unplugin/issues/607
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: add first-class Rsbuild adapter","articleBody":"# Describe the feature\n\n`unplugin@3.0.0` provides first-class adapters for Vite, Webpack, Rollup, esbuild, and Rspack, but it does not currently expose a first-class Rsbuild adapter.\n\nSpecifically, there is no:\n\n- `createRsbuildPlugin(factory)`\n- `createUnplugin(factory).rsbuild`\n\nRsbuild is built on top of Rspack, so many unplugin-based transforms can work in an Rsbuild project through a manual Rspack configuration workaround. However, package authors cannot expose a clean `my-plugin/rsbuild` entrypoint with the same ergonomics as existing adapters.\n\n## Motivation\n\nRsbuild users currently need to wire unplugin-based Rspack plugins through `tools.rspack`, which is less discoverable and less consistent than the existing adapter model.\n\nFor plugin authors, this also means packages can expose:\n\n- `my-plugin/vite`\n- `my-plugin/webpack`\n- `my-plugin/rollup`\n- `my-plugin/esbuild`\n- `my-plugin/rspack`\n\nbut not a native:\n\n- `my-plugin/rsbuild`\n\nA first-class Rsbuild adapter would make Rsbuild support consistent with the rest of the supported build tools.\n\n## Proposed API\n\n```ts\nimport {createRsbuildPlugin} from 'unplugin'\nimport {unpluginFactory} from './index.js'\n\nexport default createRsbuildPlugin(unpluginFactory)\n```\n\nAnd through `createUnplugin`:\n\n```ts\nimport {createUnplugin} from 'unplugin'\n\nconst plugin = createUnplugin(factory)\n\nexport default plugin.rsbuild\n```\n\n## Expected Usage\n\n```ts\n// rsbuild.config.ts\nimport {defineConfig} from '@rsbuild/core'\nimport myPlugin from 'my-plugin/rsbuild'\n\nexport default defineConfig({\n plugins: [\n myPlugin({\n /* plugin options */\n }),\n ],\n})\n```\n\n## Current Workaround\n\nToday, Rsbuild users can often route the Rspack adapter manually through `tools.rspack`:\n\n```ts\n// rsbuild.config.ts\nimport {defineConfig} from '@rsbuild/core'\nimport myPlugin from 'my-plugin/rspack'\n\nexport default defineConfig({\n tools: {\n rspack(config) {\n config.plugins ??= []\n config.plugins.push(myPlugin())\n },\n },\n})\n```\n\nThis works for some plugins, but it is not as ergonomic or discoverable as a native Rsbuild plugin. It also requires users to know that Rsbuild is Rspack-based and that the Rspack adapter can be manually inserted into the generated Rspack config.\n\n### Additional information\n\n- [x] Would you be willing to help implement this feature?","author":{"url":"https://github.com/yslpn","@type":"Person","name":"yslpn"},"datePublished":"2026-06-14T08:28:21Z","url":"https://github.com/unjs/unplugin/issues/607"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f28f0b3e-a9d4-b394-7a07-4a775113886f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E81C:2148FB:2BF1EF0:3C0C77C:6B0058CB |
| html-safe-nonce | beecc4d524f7cd3d7f07d80918f7442a940ec6c169e3dd5956b00219f11fabed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODFDOjIxNDhGQjoyQkYxRUYwOjNDMEM3N0M6NkIwMDU4Q0IiLCJ2aXNpdG9yX2lkIjoiMzIxMTcxOTI2NzAzNjkxOTc5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 37eecf83dac9172b37d5eef1cf6e1eb17bbf380bbc82b513d8a3e71040168c20 |
| hovercard-subject-tag | issue:4658440652 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/unjs/unplugin/607/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cc4655a4ec7e9d22dbcd517c94d9469b5ce42a7bbf136166c0ee82edac446be4/unjs/unplugin/issues/607 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cc4655a4ec7e9d22dbcd517c94d9469b5ce42a7bbf136166c0ee82edac446be4/unjs/unplugin/issues/607 |
| og:image:alt | Describe the feature unplugin@3.0.0 provides first-class adapters for Vite, Webpack, Rollup, esbuild, and Rspack, but it does not currently expose a first-class Rsbuild adapter. Specifically, there... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yslpn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| turbo-cache-control | no-preview |
| go-import | github.com/unjs/unplugin git https://github.com/unjs/unplugin.git |
| octolytics-dimension-user_id | 80154025 |
| octolytics-dimension-user_login | unjs |
| octolytics-dimension-repository_id | 385261169 |
| octolytics-dimension-repository_nwo | unjs/unplugin |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 385261169 |
| octolytics-dimension-repository_network_root_nwo | unjs/unplugin |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width