Skip to content

fix(build): fold typeof window in final builds - #29

Draft
fengmk2 wants to merge 1 commit into
mainfrom
fix/typeof-window-final-build
Draft

fix(build): fold typeof window in final builds#29
fengmk2 wants to merge 1 commit into
mainfrom
fix/typeof-window-final-build

Conversation

@fengmk2

@fengmk2 fengmk2 commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Rolldown 1.2.1 received Oxc 0.142.0 through rolldown/rolldown#10497. That Oxc release includes oxc-project/oxc#24791, which preserves default-parameter side effects.

The correct side-effect behavior exposes a native define scope error. The transform can treat a body declaration such as var window as visible to a default parameter. It then keeps a browser-only dynamic import in a server build.

This change runs the vinext scope-aware typeof window transform in all production builds. It continues to use the native Vite define. It does not change the Vite+ version.

The regression test checks the final-build transform with a default parameter and a body-local var window.

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.

1 participant