Skip to content

Commit c0106f6

Browse files
committed
refactor(@angular-devkit/build-angular): remove usage of rimraf package
Use Node.JS `rmdirSync` instead.
1 parent 2539023 commit c0106f6

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

packages/angular_devkit/build_angular/BUILD.bazel

-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ ts_library(
130130
"@npm//@types/node",
131131
"@npm//@types/parse5-html-rewriting-stream",
132132
"@npm//@types/postcss-preset-env",
133-
"@npm//@types/rimraf",
134133
"@npm//@types/sass",
135134
"@npm//@types/semver",
136135
"@npm//@types/text-table",
@@ -171,7 +170,6 @@ ts_library(
171170
"@npm//raw-loader",
172171
"@npm//regenerator-runtime",
173172
"@npm//resolve-url-loader",
174-
"@npm//rimraf",
175173
"@npm//rxjs",
176174
"@npm//sass",
177175
"@npm//sass-loader",

packages/angular_devkit/build_angular/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"raw-loader": "4.0.2",
5454
"regenerator-runtime": "0.13.7",
5555
"resolve-url-loader": "4.0.0",
56-
"rimraf": "3.0.2",
5756
"rxjs": "6.6.7",
5857
"sass": "1.34.1",
5958
"sass-loader": "12.0.0",

packages/angular_devkit/build_angular/src/utils/delete-output-dir.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
import { rmdirSync } from 'fs';
910
import { resolve } from 'path';
10-
import * as rimraf from 'rimraf';
1111

1212
/**
1313
* Delete an output directory, but error out if it's the root of the project.
1414
*/
15-
export function deleteOutputDir(root: string, outputPath: string) {
15+
export function deleteOutputDir(root: string, outputPath: string): void {
1616
const resolvedOutputPath = resolve(root, outputPath);
1717
if (resolvedOutputPath === root) {
1818
throw new Error('Output path MUST not be project root directory!');
1919
}
2020

21-
rimraf.sync(resolvedOutputPath);
21+
rmdirSync(resolvedOutputPath, { recursive: true, maxRetries: 3 });
2222
}

packages/angular_devkit/build_angular/src/utils/i18n-options.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { json } from '@angular-devkit/core';
1111
import * as fs from 'fs';
1212
import * as os from 'os';
1313
import * as path from 'path';
14-
import * as rimraf from 'rimraf';
1514
import { Schema as BrowserBuilderSchema } from '../browser/schema';
1615
import { Schema as ServerBuilderSchema } from '../server/schema';
1716
import { readTsconfig } from '../utils/read-tsconfig';
@@ -268,7 +267,7 @@ export async function configureI18nBuild<T extends BrowserBuilderSchema | Server
268267
// Remove temporary directory used for i18n processing
269268
process.on('exit', () => {
270269
try {
271-
rimraf.sync(tempPath);
270+
fs.rmdirSync(tempPath, { recursive: true, maxRetries: 3 });
272271
} catch {}
273272
});
274273
}

0 commit comments

Comments
 (0)