Skip to content

Commit dc60225

Browse files
committed
refactor(@angular/build): remove redundant path resolution logic in Vitest plugin
This commit removes a redundant code block in the `resolveId` hook of the Vitest plugin. The logic for resolving relative imports is fully covered by the subsequent generic path resolution strategy, reducing code duplication and complexity.
1 parent 7c0b0f1 commit dc60225

File tree

1 file changed

+0
-14
lines changed
  • packages/angular/build/src/builders/unit-test/runners/vitest

1 file changed

+0
-14
lines changed

packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -217,20 +217,6 @@ export function createVitestPlugins(pluginOptions: PluginOptions): VitestPlugins
217217
}
218218
}
219219

220-
if (importer && (id[0] === '.' || id[0] === '/')) {
221-
let fullPath;
222-
if (testFileToEntryPoint.has(importer)) {
223-
fullPath = toPosixPath(path.join(workspaceRoot, id));
224-
} else {
225-
fullPath = toPosixPath(path.join(path.dirname(importer), id));
226-
}
227-
228-
const relativePath = path.relative(workspaceRoot, fullPath);
229-
if (buildResultFiles.has(toPosixPath(relativePath))) {
230-
return fullPath;
231-
}
232-
}
233-
234220
// Determine the base directory for resolution.
235221
let baseDir: string;
236222
if (importer) {

0 commit comments

Comments
 (0)