diff --git a/packages/angular_devkit/build_angular/src/builders/browser-esbuild/sass-plugin.ts b/packages/angular_devkit/build_angular/src/builders/browser-esbuild/sass-plugin.ts index 8a60c9215e66..7c3ea8fb5bd4 100644 --- a/packages/angular_devkit/build_angular/src/builders/browser-esbuild/sass-plugin.ts +++ b/packages/angular_devkit/build_angular/src/builders/browser-esbuild/sass-plugin.ts @@ -124,7 +124,11 @@ async function compileString( if (packageResult.path) { return pathToFileURL( - join(dirname(packageResult.path), !hasScope ? nameOrFirstPath : '', ...pathPart), + join( + dirname(packageResult.path), + !hasScope && nameOrFirstPath ? nameOrFirstPath : '', + ...pathPart, + ), ); } }