Skip to content

Commit

Permalink
wip: default of skipSelf is now true
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Sep 30, 2023
1 parent ddde37f commit 49dafa0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
}
}

const resolved = await this.resolve(url, importerFile)
const resolved = await this.resolve(url, importerFile, {
skipSelf: false,
})

if (!resolved) {
// in ssr, we should let node handle the missing modules
Expand Down
5 changes: 1 addition & 4 deletions packages/vite/src/node/plugins/optimizedDeps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ export function optimizedDepsBuildPlugin(config: ResolvedConfig): Plugin {
// When a optimized dep is aliased, we need to avoid waiting for it before optimizing
return
}
const resolved = await this.resolve(id, importer, {
...options,
skipSelf: true,
})
const resolved = await this.resolve(id, importer, options)
if (resolved && !resolved.external) {
depsOptimizer.delayDepsOptimizerUntil(resolved.id, async () => {
await this.load(resolved)
Expand Down
1 change: 0 additions & 1 deletion packages/vite/src/node/plugins/preAlias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export function preAliasPlugin(config: ResolvedConfig): Plugin {
const resolved = await this.resolve(id, importer, {
...options,
custom: { ...options.custom, 'vite:pre-alias': true },
skipSelf: true,
})
if (resolved && !depsOptimizer.isOptimizedDepFile(resolved.id)) {
const optimizeDeps = depsOptimizer.options
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/pluginContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export async function createPluginContainer(
},
) {
let skip: Set<Plugin> | undefined
if (options?.skipSelf && this._activePlugin) {
if (options?.skipSelf !== false && this._activePlugin) {
skip = new Set(this._resolveSkips)
skip.add(this._activePlugin)
}
Expand Down

0 comments on commit 49dafa0

Please sign in to comment.