Skip to content

[WIP] Fix onwarn reads from wrong config key in Vite 8 branch#3

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-onwarn-reading-config-key
Closed

[WIP] Fix onwarn reads from wrong config key in Vite 8 branch#3
Copilot wants to merge 1 commit intomainfrom
copilot/fix-onwarn-reading-config-key

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 22, 2026

Cloud agent has begun work on fix(vite-8): remove ... and will update this pull request as work progresses.

Original prompt

last week
Review submitted successfully. Here's a summary of what I flagged on PR cloudflare#548:

Requested Changes (6 inline comments)

  1. Bug: onwarn reads from wrong config key in Vite 8 branch — The Vite 8 rolldownOptions branch captures config.build?.rollupOptions?.onwarn to
    preserve user warning handlers, but Vite 8 users would configure onwarn under rolldownOptions. The user's onwarn is silently dropped. Suggested fix:
    read from both rolldownOptions and rollupOptions to cover the transition.

  2. Multi-env Vite 8 path is untested — The integration test at line 436 asserts result.environments.client.build.rollupOptions.treeshake (Vite 7
    shape). On Vite 8, getClientBuildOptionsWithInput() returns rolldownOptions instead, so this test doesn't cover the Vite 8 multi-env path at all.

  3. Duplicated onwarn closure — The 15-line onwarn factory is copy-pasted across both the Vite 7 and Vite 8 branches. Suggested extracting into a
    createDirectiveOnwarn() helper.

  4. Broad as any cast — The entire Vite 8 build config is cast as any (line 1353), disabling type checking for that whole branch. Suggested a narrower
    escape hatch.

  5. Near-identical getClientBuildOptions / getClientBuildOptionsWithInput — These two functions share ~95% logic and differ only by an optional input
    field. Suggested collapsing into a single function with an optional parameter.

  6. Unverified moduleSideEffects: "no-external" support in Rolldown — The comment claims this is supported, but no verification has been documented. If
    Rolldown doesn't support it, the barrel-library DCE optimization is silently lost.

github run

yunus25jmi1 added 4 commits 2 hours ago
@yunus25jmi1
fix: address bonk review comments for Vite 8/Rolldown
1e6744e
@yunus25jmi1
fix: resolve merge conflict and apply robust onwarn logic
029d279 ...

Created from VS Code.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

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.

2 participants