Skip to content

chore: replace vite with rsbuild#5

Merged
guqing merged 3 commits intoguqing:mainfrom
ruibaby:chore/rsbuild
Jun 24, 2025
Merged

chore: replace vite with rsbuild#5
guqing merged 3 commits intoguqing:mainfrom
ruibaby:chore/rsbuild

Conversation

@ruibaby
Copy link
Copy Markdown
Contributor

@ruibaby ruibaby commented Jun 18, 2025

使用 Halo 新提供的 @halo-dev/ui-plugin-bundler-kit 的 Rsbuild 配置来构建前端资源,利用代码分割特性降低 main.js 体积。

dev:

image

build:

image
降低 bundle.js 体积,提升 Console 访问速度。

ruibaby added 2 commits June 18, 2025 12:42
Signed-off-by: Ryan Wang <i@ryanc.cc>
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 guqing merged commit f876d2d into guqing:main Jun 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants