Commit f12e47f
authored
fix: prefer using Rspack/Rsbuild v2 config (#470)
* chore(deps): upgrade Rsbuild/Rspack to 2.0.0-rc.2
- Bump `@rsbuild/core` devDependencies to `^2.0.0-rc.2` across all packages
- Bump sandbox plugins to Rsbuild v2 compatible versions:
- `@rsbuild/plugin-react` → `^2.0.0-rc.2`
- `@rsbuild/plugin-vue` → `^2.0.0-alpha.3`
- `@rsbuild/plugin-sass` → `^2.0.0-alpha.3`
- `@rsbuild/plugin-babel` → `^2.0.0-alpha.3`
- `@rspack/core` / `@rspack/cli` → `^2.0.0-rc.2`
- `@rspack/plugin-react-refresh` → `^2.0.0`
- Migrate `performance.chunkSplit` to top-level `splitChunks` for Rsbuild v2,
with runtime version detection to preserve Rsbuild v1 compatibility
- Add `// Rspack v1 compatible:` comments to all v1 compat code paths
- All peerDependencies remain `^1.5.0 || ^2.0.0-0` (no major version bump)
* fix(addon-modernjs): cast RsbuildConfig to align cross-package types
Modern.js internally resolves a different version of @rsbuild/core,
causing RsbuildConfig type mismatch with mergeRsbuildConfig.
* fix: revert incompatible sandbox plugin versions
- Keep `performance.chunkSplit` for both v1 and v2 since
`@rsbuild/plugin-vue@2.0.0-alpha.3` still reads `chunkSplit.strategy`
- Revert `@rsbuild/plugin-sass` to `^1.5.1` in rslib sandboxes (v2 alpha
has breaking changes with sass module resolution)
- Revert `@rspack/plugin-react-refresh` to `^1.6.1` (v2 is ESM-only,
incompatible with CJS rspack config)
* fix(sandboxes): migrate rspack config to ESM and fix plugin compat
- Convert `rspack.config.cjs` to `rspack.config.mjs` for
`@rspack/plugin-react-refresh@2.0.0` ESM compatibility
- Use named export `ReactRefreshRspackPlugin` (v2 dropped default export)
- Keep `@rsbuild/plugin-sass@^1.5.1` in rslib sandboxes since
`@rsbuild/plugin-sass@2.0.0-alpha.3` is too old for `@rsbuild/core@rc.2`
* fix(builder-rsbuild): use rspackVersion for version detection, drop splitChunks
- Use `rspack.rspackVersion` instead of `rspack.version` for major
version detection. `rspack.version` returns the webpack-compat version
(5.75.0), not the actual Rspack version.
- Remove top-level `splitChunks` config to avoid overriding user-provided
`performance.chunkSplit` settings from rsbuild.config. When both are
present, Rsbuild v2 ignores `performance.chunkSplit` entirely.
- Keep using `performance.chunkSplit` only, which is deprecated but still
functional in Rsbuild v2, preserving v1 compatibility.
* fix(builder-rsbuild): use v1/v2 conditional splitChunks and revert plugin-vue
- Use rspackMajorVersion to conditionally apply `performance.chunkSplit` (v1)
or top-level `splitChunks` (v2) instead of deprecated-but-functional fallback.
- Revert `@rsbuild/plugin-vue` to 1.2.7 in vue3/lit/rslib-vue3 sandboxes
because alpha.3 crashes when `performance.chunkSplit` is absent in v2 branch.1 parent 5769aa3 commit f12e47f
File tree
28 files changed
+669
-993
lines changed- packages
- addon-modernjs
- src
- addon-rslib
- builder-rsbuild
- src
- plugins
- preview
- framework-html
- framework-react-native-web
- framework-react
- framework-vue3
- framework-web-components
- rsbuild-plugin-react-native-web
- sandboxes
- lit
- modernjs-react-mf/host
- modernjs-react
- react-16
- react-18
- react-native-web
- react-testing
- rslib-react-component
- rslib-react-mf
- rslib-vue3-component
- rspack-react-18
- vanilla-ts
- vue3
28 files changed
+669
-993
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
Lines changed: 26 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
293 | 308 | | |
294 | 309 | | |
295 | 310 | | |
| |||
394 | 409 | | |
395 | 410 | | |
396 | 411 | | |
397 | | - | |
| 412 | + | |
398 | 413 | | |
399 | 414 | | |
400 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
0 commit comments