mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-18 03:23:57 +08:00
The use of the custom path functions from `@angular-devkit/core` have been removed in favor of the built-in functions from Node.js. These provide equivalent functionality with an improvement in performance. The amount of custom code executed has also been reduced.
18 lines
441 B
TypeScript
18 lines
441 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import { join, relative } from 'node:path/posix';
|
|
|
|
export function relativePathToWorkspaceRoot(projectRoot: string | undefined): string {
|
|
if (!projectRoot) {
|
|
return '.';
|
|
}
|
|
|
|
return relative(join('/', projectRoot), '/') || '.';
|
|
}
|