Skip to content

Commit ada493e

Browse files
authored
feat: warn when vite-tsconfig-paths plugin is detected (#21781)
1 parent f05be0e commit ada493e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/vite/src/node/config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,21 @@ export async function resolveConfig(
14651465
customLogger: config.customLogger,
14661466
})
14671467

1468+
const tsconfigPathsPlugin = userPlugins.find(
1469+
(p) =>
1470+
p.name === 'vite-tsconfig-paths' ||
1471+
p.name === 'vite-plugin-tsconfig-paths',
1472+
)
1473+
if (tsconfigPathsPlugin) {
1474+
logger.warnOnce(
1475+
colors.yellow(
1476+
`The plugin ${JSON.stringify(tsconfigPathsPlugin.name)} is detected. ` +
1477+
`Vite now supports tsconfig paths resolution natively via the ${colors.bold('resolve.tsconfigPaths')} option. ` +
1478+
`You can remove the plugin and set ${colors.bold('resolve.tsconfigPaths: true')} in your Vite config instead.`,
1479+
),
1480+
)
1481+
}
1482+
14681483
// resolve root
14691484
const resolvedRoot = normalizePath(
14701485
config.root ? path.resolve(config.root) : process.cwd(),

0 commit comments

Comments
 (0)