-
Notifications
You must be signed in to change notification settings - Fork 249
Description
Description
After upgrading to vinext 0.0.30 with Vite 8.0.0, the build produces warnings about deprecated config options:
Warning: Invalid input options (1 issue found)
- For the "treeshake.preset". Invalid key: Expected never but received "preset".
Warning: Invalid output options (1 issue found)
- For the "experimentalMinChunkSize". Invalid key: Expected never but received "experimentalMinChunkSize".
Exact Location
The deprecated options are defined in packages/vinext/src/index.ts:
Line 493-496 - experimentalMinChunkSize:
const clientOutputConfig = {
manualChunks: clientManualChunks,
experimentalMinChunkSize: 10_000, // REMOVED in Vite 8 (Rolldown)
};Line 523-526 - treeshake.preset:
const clientTreeshakeConfig = {
preset: "recommended" as const, // INVALID in Vite 8 (Rolldown)
moduleSideEffects: "no-external" as const,
};These configs are applied in multiple places:
- Lines 1235, 1243 (multi-env builds)
- Lines 1447-1448, 1466-1467 (Pages Router)
packages/vinext/src/cli.tslines 390-391 (CLI builds)
Root Cause
Vite 8 uses Rolldown instead of Rollup. These options are Rollup-specific:
-
experimentalMinChunkSize- This was a Rollup feature, removed in Vite 8/Rolldown. Rolldown handles chunk merging differently. -
treeshake.preset- This was a Rollup treeshake option. In Vite 8 with Rolldown, treeshake configuration should usebuild.rolldownOptions.treeshakeinstead.
Suggested Fix
Based on Vite 8 migration docs, the fix options are:
- Remove entirely - Vite 8/Rolldown has better default treeshaking
- Use Vite 8 config - Move treeshake config to
build.rolldownOptions.treeshake - Conditional application - Only apply these options when building with Vite 7
Example fix for treeshake:
// Instead of treeshake.preset, use:
build: {
rolldownOptions: {
treeshake: {
moduleSideEffects: "no-external",
},
},
}For experimentalMinChunkSize - this feature may need to be reimplemented differently or removed if Rolldown handles it automatically.
Impact
- Build still works (Vite 8 silently ignores invalid keys)
- Some optimizations may not be applied
- Produces warning noise in CI/CD
Environment
- vinext: 0.0.30
- vite: 8.0.0
- @cloudflare/vite-plugin: 1.28.0