mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #746] [MERGED] fix(build): eliminate Vite 8 treeshake.preset warning #812
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#812
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/746
Author: @Divkix
Created: 4/2/2026
Status: ✅ Merged
Merged: 4/2/2026
Merged by: @james-elicx
Base:
main← Head:fix/vite8-treeshake-preset-warning📝 Commits (4)
4b6c58afix(build): eliminate Vite 8 treeshake.preset warning63152c2refactor(build): address PR review feedback for treeshake config90dd87fdocs(build): clarify Rolldown treeshake divergence in comments146475echore: address PR review feedback on treeshake config📊 Changes
3 files changed (+79 additions, -30 deletions)
View changed files
📝
examples/app-router-playground/vite.config.ts(+0 -23)📝
packages/vinext/src/index.ts(+47 -5)📝
tests/build-optimization.test.ts(+32 -2)📄 Description
Summary
Fixes #540 - Vite 8 builds produce warnings about the deprecated "treeshake.preset" option.
Problem
The "treeshake.preset" option is Rollup-specific and not supported by Rolldown (Vite 8's bundler). This causes build warnings:
Solution
Added version-gated "getClientTreeshakeConfigForVite(viteMajorVersion)" function that returns:
{ preset: "recommended", moduleSideEffects: "no-external" }(Rollup-compatible){ moduleSideEffects: "no-external" }(Rolldown-compatible, no preset)The "moduleSideEffects: "no-external"" option is valid in both bundlers and provides the key optimization for barrel-exporting libraries.
Changes
Testing
Backward Compatibility
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.