Skip to content

Default to --configLoader=native #21546

@sapphi-red

Description

@sapphi-red

Description

Currently there are multiple config loaders: #20162
Each option has its own downsides and upsides.

Suggested solution

We think --configLoader=native is the least confusing one and plan to default to that.
This will also solve #5370.

Alternative

No response

Additional context

To the ease the migration, our plan is to:

  1. Set ⁨⁨moduleResolution: 'nodenext'⁩⁩ in ⁨⁨tsconfig.node.json⁩⁩ of create-vite (⁨⁨erasableSyntaxOnly: true⁩⁩ is already set).
  2. Finish feat: track dependencies when loading config with native #19374
  3. Add runtime warnings to configs with ⁨⁨__dirname⁩⁩ / ⁨⁨__filename⁩⁩, extension-less imports. Update docs to recommend ⁨⁨moduleResolution: 'nodenext'⁩⁩ + ⁨⁨erasableSyntaxOnly: true⁩⁩ for configs.
  4. (Vite 9) Default to ⁨⁨--configLoader native⁩⁩. Deprecate other config loaders.
  5. (Vite 10) Remove other config loaders and ⁨⁨--configLoader⁩⁩ flag.

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions