Emit valid rolldown-vite options in generated vite.config.js
Type of change
- Bug fix (non-breaking change which fixes an issue)
Changes To Core Features:
- Have you added an explanation of what your changes do and why you'd like us to include them?
- Have you written new tests for your core changes, as applicable?
- Have you successfully ran tests with your changes locally?
Description
Found during 0.9.9a1 pre-release testing (FINDING-012/015/019). Every prod build/export logs two rolldown-vite warnings, twice each (client + ssr environment builds):
Warning: Invalid input options (1 issue found) - For the "jsx". Invalid key: Expected never but received "jsx".WARN advancedChunks option is deprecated, please use codeSplitting instead.
The generated .web/vite.config.js (template in packages/reflex-base/src/reflex_base/compiler/templates.py) passes two legacy options in build.rollupOptions:
jsx: {}— carried over from the remix/react-router migration (#4984).jsxis no longer a rolldown input option (JSX is handled by vite/oxc; rolldown moved it undertransform.jsx), so rolldown-vite 8.x rejects and ignores it — it is a no-op today, and dropping it preserves current behavior exactly.output.advancedChunks— deprecated by rolldown in favor ofoutput.codeSplitting, which accepts the identical{ groups: [...] }shape (confirmed in rolldown 1.2.6's option schema:codeSplitting: boolean | AdvancedChunksSchema). Renamed in place.
Pre-existing since at least 0.9.8 (both pinned rolldown-vite versions 8.0.16 and 8.2.0 warn identically) — not a 0.9.9a1 regression, but advancedChunks is slated for removal so it would eventually break.
Test plan
- Regression test
tests/units/utils/test_utils.py::test_vite_config_template_valid_rolldown_options: asserts the template no longer emitsjsx: {}oradvancedChunksand emitscodeSplittingwith thereflex-envgroup. Fails on unfixed main (template emitsjsx: {}), passes with the fix. - End-to-end:
reflex init --template blank+reflex export --frontend-only --loglevel debugon this branch — both warnings gone from build output, export exits 0, and the build output structure is byte-for-byte identical to the unfixed baseline (thereflex-envchunk is still split out with the same content hash), so chunking behavior is preserved. uv run ruff check ./uv run ruff format .clean;uv run pyrightclean on touched files; scopeduv run pytest tests/units/utils/test_utils.py tests/units/plugins/test_embed.py tests/units/compilerall pass (483 passed).
Note: open PR #6959 touches the same template function (plugin import extension + resolveId filter). This change only edits the rollupOptions block, so no duplication — at most a trivial merge conflict in adjacent lines.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EMjBXPozsNeQNSBZecNH8x
Generated by Claude Code