diff --git a/packages/vite/src/node/plugins/preAlias.ts b/packages/vite/src/node/plugins/preAlias.ts index c29cb66b4d777c..693b70bdf1ed91 100644 --- a/packages/vite/src/node/plugins/preAlias.ts +++ b/packages/vite/src/node/plugins/preAlias.ts @@ -53,10 +53,7 @@ export function preAliasPlugin(config: ResolvedConfig): Plugin { if (depsOptimizer.options.noDiscovery) { return } - const resolved = await this.resolve(id, importer, { - ...options, - custom: { ...options.custom, 'vite:pre-alias': true }, - }) + const resolved = await this.resolve(id, importer, options) if (resolved && !depsOptimizer.isOptimizedDepFile(resolved.id)) { const optimizeDeps = depsOptimizer.options const resolvedId = cleanUrl(resolved.id)