Skip to content

Commit

Permalink
fix: revert-resolve-options
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Jul 30, 2024
1 parent ee5f86d commit 810a88e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions packages/vite/src/node/server/pluginContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,25 +521,26 @@ class PluginContext implements Omit<RollupPluginContext, 'cache'> {
return this._container.getModuleInfo(id)
}

// @ts-expect-error
async resolve(
id: string,
importer?: string,
options?: {
// attributes?: Record<string, string>
// custom?: CustomPluginOptions
// isEntry?: boolean
// skipSelf?: boolean
attributes?: Record<string, string>
custom?: CustomPluginOptions
isEntry?: boolean
skipSelf?: boolean
},
): ReturnType<RollupPluginContext['resolve']> {
let skip: Set<Plugin> | 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,
Expand Down Expand Up @@ -793,6 +794,7 @@ class LoadPluginContext extends PluginContext {
}
}

// @ts-expect-error
class TransformPluginContext
extends LoadPluginContext
implements Omit<RollupTransformPluginContext, 'cache'>
Expand Down

0 comments on commit 810a88e

Please sign in to comment.