chore: replace vite with rsbuild#5
Merged
guqing merged 3 commits intoguqing:mainfrom Jun 24, 2025
Merged
Conversation
Signed-off-by: Ryan Wang <i@ryanc.cc>
f2c-ci-robot Bot
pushed a commit
to halo-dev/halo
that referenced
this pull request
Jun 18, 2025
#### What type of PR is this?
/area ui
/kind feature
/area plugin
/milestone 2.21.x
#### What this PR does / why we need it:
This PR adds Rsbuild preset configuration support and refactors the Vite preset configuration approach for `@halo-dev/ui-plugin-bundler-kit`.
- **Added Rsbuild support** - New `rsbuildConfig` function with pre-configured settings for Halo plugin development
- **Refactored Vite configuration** - Improved `viteConfig` function with better preset handling
- **Updated documentation** - Comprehensive README with usage examples and build tool comparison
example:
```typescript
// Vite
import { viteConfig } from "@halo-dev/ui-plugin-bundler-kit";
export default viteConfig({ vite: { /* custom config */ } });
// Rsbuild
import { rsbuildConfig } from "@halo-dev/ui-plugin-bundler-kit";
export default rsbuildConfig({ rsbuild: { /* custom config */ } });
```
real-world example: guqing/plugin-metrics-graph#5
For detailed configuration options and examples, please refer to the updated README.md
⚠️ `HaloUIPluginBundlerKit` function is now deprecated (still functional but marked for removal)
#### Which issue(s) this PR fixes:
Fixes #
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
重构 `@halo-dev/ui-plugin-bundler-kit`,以预配置的方式为插件提供 Vite 和 Rsbuild 的构建配置。
```
Signed-off-by: Ryan Wang <i@ryanc.cc>
guqing
approved these changes
Jun 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
使用 Halo 新提供的
@halo-dev/ui-plugin-bundler-kit的 Rsbuild 配置来构建前端资源,利用代码分割特性降低 main.js 体积。dev:
build: