From 810a88e891d4d99f61cb8d6b4570c785290f7019 Mon Sep 17 00:00:00 2001 From: underfin Date: Tue, 30 Jul 2024 15:07:11 +0800 Subject: [PATCH] fix: revert-resolve-options --- .../vite/src/node/server/pluginContainer.ts | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index 0349861c73f200..6e1711edc63160 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -521,25 +521,26 @@ class PluginContext implements Omit { return this._container.getModuleInfo(id) } + // @ts-expect-error async resolve( id: string, importer?: string, options?: { - // attributes?: Record - // custom?: CustomPluginOptions - // isEntry?: boolean - // skipSelf?: boolean + attributes?: Record + custom?: CustomPluginOptions + isEntry?: boolean + skipSelf?: boolean }, ): ReturnType { let skip: Set | undefined - // if (options?.skipSelf !== false && this._plugin) { - // skip = new Set(this._resolveSkips) - // skip.add(this._plugin) - // } + if (options?.skipSelf !== false && this._plugin) { + skip = new Set(this._resolveSkips) + skip.add(this._plugin) + } let out = await this._container.resolveId(id, importer, { - // attributes: options?.attributes, - // custom: options?.custom, - // isEntry: !!options?.isEntry, + attributes: options?.attributes, + custom: options?.custom, + isEntry: !!options?.isEntry, skip, ssr: this.ssr, scan: this._scan, @@ -793,6 +794,7 @@ class LoadPluginContext extends PluginContext { } } +// @ts-expect-error class TransformPluginContext extends LoadPluginContext implements Omit