Skip to content

Improve Vite Configuration DX by Using Overridable Defaults, Guardrails and Docs #824

@justinvdm

Description

@justinvdm

A user pointed out that the developer experience for customizing Vite configurations can be confusing. Some settings are controlled by the framework, while others follow Vite's defaults. This can make it unclear what is safe or effective to customize.

This ticket proposes a plan to improve this experience:

  1. Refactor to Overridable Defaults: Move framework-controlled Vite settings into a base configuration that users can override. The default behavior will remain the same, but the mechanism will be more transparent and flexible.

  2. Establish Clear Guardrails: The build process for the and environments has strict requirements due to the multi-pass linking, RSC, and Cloudflare-specific transforms. We need to:

    • Document which configuration areas are "owned" by the framework and should not be modified (e.g., and , , etc.).
    • Implement warnings that log to the console if a user's attempts to override a protected setting in these environments.
  3. Improve Documentation: Create a dedicated documentation page that explains:

    • The framework's default Vite configuration.
    • The recommended way to customize the build.
    • A clear list of the established guardrails and why they exist.

The goal is to provide users with safe, predictable control over the parts of the build that are meant to be customized, while protecting the integrity of the complex RSC/Cloudflare build orchestration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.xIssues planned for a minor release after 1.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions