Skip to content

Vite 8: deprecated config options cause build warnings #540

@Divkix

Description

@Divkix

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.ts lines 390-391 (CLI builds)

Root Cause

Vite 8 uses Rolldown instead of Rollup. These options are Rollup-specific:

  1. experimentalMinChunkSize - This was a Rollup feature, removed in Vite 8/Rolldown. Rolldown handles chunk merging differently.

  2. treeshake.preset - This was a Rollup treeshake option. In Vite 8 with Rolldown, treeshake configuration should use build.rolldownOptions.treeshake instead.

Suggested Fix

Based on Vite 8 migration docs, the fix options are:

  1. Remove entirely - Vite 8/Rolldown has better default treeshaking
  2. Use Vite 8 config - Move treeshake config to build.rolldownOptions.treeshake
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions