mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-21 05:52:41 +08:00
refactor(@schematics/angular): use built-in POSIX path utilities for library schematic
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.
This commit is contained in:
parent
5343c31152
commit
fab40ea9f1
@ -6,7 +6,6 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import { join, normalize } from '@angular-devkit/core';
|
||||
import {
|
||||
Rule,
|
||||
SchematicContext,
|
||||
@ -22,6 +21,7 @@ import {
|
||||
url,
|
||||
} from '@angular-devkit/schematics';
|
||||
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
|
||||
import { join } from 'node:path/posix';
|
||||
import { NodeDependencyType, addPackageJsonDependency } from '../utility/dependencies';
|
||||
import { JSONFile } from '../utility/json-file';
|
||||
import { latestVersions } from '../utility/latest-versions';
|
||||
@ -138,8 +138,8 @@ export default function (options: LibraryOptions): Rule {
|
||||
|
||||
const libDir =
|
||||
options.projectRoot !== undefined
|
||||
? normalize(options.projectRoot)
|
||||
: join(normalize(newProjectRoot), folderName);
|
||||
? join(options.projectRoot)
|
||||
: join(newProjectRoot, folderName);
|
||||
|
||||
const distRoot = `dist/${folderName}`;
|
||||
const sourceDir = `${libDir}/src/lib`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user