fix: warn on deprecated envFile#22555
Conversation
|
I checked the remaining red check. The Vite CI matrix is green; the failing |
|
One follow-up from the empirical pass on the linked issue: at HEAD, Existing precedent for that situation is at if (config.envFile === false) {
logger.warn(
colors.yellow(
`You or a plugin you are using have set \`envFile: false\` ` +
`but this option is now deprecated. ` +
`Please use \`envDir: false\` instead.`,
),
)
}Conditional on the sequencing question on #22547 going this direction (rather than coordinating a React Router PR first). Either way the framing tweak is small. |
What changed
envFile: falseis used.envFile: falsetoenvDir: false.envDir: falsepath.Why
envFileis already marked deprecated in the type definition, but the runtime path stayed silent. This makes migration harder for programmatic API users and leaves behavior inconsistent with other deprecated Vite options that warn when used.Impact
Users who still pass
envFile: falsenow get a clear migration hint without changing behavior. Consumers already onenvDir: falsekeep the same experience with no extra warning.Validation
pnpm vitest run packages/vite/src/node/__tests__/config.spec.ts -t "envFile option|envDir to disable env files"pnpm exec eslint packages/vite/src/node/config.ts packages/vite/src/node/__tests__/config.spec.tspnpm exec oxfmt --check packages/vite/src/node/config.ts packages/vite/src/node/__tests__/config.spec.ts docs/guide/migration.md