#21546·Vite

Default to `--configLoader=native`

Author: sapphi-redCreated Feb 3, 2026Updated Sep 25, 2026

Description

Currently there are multiple config loaders: https://github.com/vitejs/vite/discussions/20162 Each option has its own downsides and upsides.

Suggested solution

We think the native config loader (--configLoader=native) is the least confusing one among all the loaders and plan to default to it.

While it has some stricter behaviors like extension-less imports are disallowed, other tools will likely to use the native loading approach for configs, and thus the limitation is less surprising than the other approaches. By switching to the native loader, #5370 and #19730 can also be solved (these were some of the downsides of the bundle loader). This is also helpful for other Vite stack tools and potentially other tools as it would be easier to share the same loading mechanism easily.

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 https://github.com/vitejs/vite/pull/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