Skip to content

Commit c1d06f3

Browse files
committed
fixup! fix(@angular/build): resolve Vitest artifacts when workspace root is aliased
1 parent 67d327f commit c1d06f3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • packages/angular/build/src/builders/unit-test/runners/vitest

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,11 @@ export function createVitestPlugins(pluginOptions: PluginOptions): Vite.Plugin[]
351351
const normalizeToWorkspace = (filePath: string): string => {
352352
if (vitestConfig?.root && path.isAbsolute(filePath)) {
353353
const relativeToVitestRoot = path.relative(vitestConfig.root, filePath);
354-
if (!relativeToVitestRoot.startsWith('..') && !path.isAbsolute(relativeToVitestRoot)) {
354+
if (
355+
relativeToVitestRoot !== '..' &&
356+
!relativeToVitestRoot.startsWith('..' + path.sep) &&
357+
!path.isAbsolute(relativeToVitestRoot)
358+
) {
355359
return path.join(workspaceRoot, relativeToVitestRoot);
356360
}
357361
}

0 commit comments

Comments
 (0)