From c581a4fa523e024dc872c61c3d061741d2511689 Mon Sep 17 00:00:00 2001 From: shulaoda <165626830+shulaoda@users.noreply.github.com> Date: Sun, 8 Mar 2026 19:13:23 +0800 Subject: [PATCH 1/2] feat: warn when vite-tsconfig-paths plugin is detected --- packages/vite/src/node/config.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 5a7ff1d619c149..f8c8429791f704 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -1465,6 +1465,22 @@ export async function resolveConfig( customLogger: config.customLogger, }) + // Warn if vite-tsconfig-paths plugin is detected, as Vite now has built-in support + const tsconfigPathsPlugin = userPlugins.find( + (p) => + p.name === 'vite-tsconfig-paths' || + p.name === 'vite-plugin-tsconfig-paths', + ) + if (tsconfigPathsPlugin) { + logger.warnOnce( + colors.yellow( + `The plugin ${JSON.stringify(tsconfigPathsPlugin.name)} is no longer needed. ` + + `Vite now supports tsconfig paths resolution natively via the ${colors.bold('resolve.tsconfigPaths')} option. ` + + `You could remove the plugin and set ${colors.bold('resolve.tsconfigPaths: true')} in your Vite config instead.`, + ), + ) + } + // resolve root const resolvedRoot = normalizePath( config.root ? path.resolve(config.root) : process.cwd(), From 61eb57d7926933f736585a24c83b9c1ed7419680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0?= Date: Wed, 11 Mar 2026 20:04:33 +0900 Subject: [PATCH 2/2] chore: tweak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 翠 --- packages/vite/src/node/config.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index f8c8429791f704..6e3a857e0abaf1 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -1465,7 +1465,6 @@ export async function resolveConfig( customLogger: config.customLogger, }) - // Warn if vite-tsconfig-paths plugin is detected, as Vite now has built-in support const tsconfigPathsPlugin = userPlugins.find( (p) => p.name === 'vite-tsconfig-paths' || @@ -1474,9 +1473,9 @@ export async function resolveConfig( if (tsconfigPathsPlugin) { logger.warnOnce( colors.yellow( - `The plugin ${JSON.stringify(tsconfigPathsPlugin.name)} is no longer needed. ` + + `The plugin ${JSON.stringify(tsconfigPathsPlugin.name)} is detected. ` + `Vite now supports tsconfig paths resolution natively via the ${colors.bold('resolve.tsconfigPaths')} option. ` + - `You could remove the plugin and set ${colors.bold('resolve.tsconfigPaths: true')} in your Vite config instead.`, + `You can remove the plugin and set ${colors.bold('resolve.tsconfigPaths: true')} in your Vite config instead.`, ), ) }