cleanup(bundling): replace fs-extra.removeSync() with fs.rmSync() (#15051)

This commit is contained in:
Phillip Barta 2023-02-17 12:40:27 +01:00 committed by GitHub
parent bb51e98190
commit 428391e124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 17 deletions

View File

@ -41,7 +41,6 @@
"babel-plugin-transform-async-to-promises": "^0.8.15", "babel-plugin-transform-async-to-promises": "^0.8.15",
"chalk": "^4.1.0", "chalk": "^4.1.0",
"dotenv": "~10.0.0", "dotenv": "~10.0.0",
"fs-extra": "^11.1.0",
"postcss": "^8.4.14", "postcss": "^8.4.14",
"rollup": "^2.56.2", "rollup": "^2.56.2",
"rollup-plugin-copy": "^3.4.0", "rollup-plugin-copy": "^3.4.0",

View File

@ -1,14 +0,0 @@
import * as path from 'path';
import { removeSync } from 'fs-extra';
/**
* Delete an output directory, but error out if it's the root of the project.
*/
export function deleteOutputDir(root: string, outputPath: string) {
const resolvedOutputPath = path.resolve(root, outputPath);
if (resolvedOutputPath === root) {
throw new Error('Output path MUST not be project root directory!');
}
removeSync(resolvedOutputPath);
}

View File

@ -1,5 +1,5 @@
import * as path from 'path'; import * as path from 'path';
import { removeSync } from 'fs-extra'; import { rmSync } from 'fs';
/** /**
* Delete an output directory, but error out if it's the root of the project. * Delete an output directory, but error out if it's the root of the project.
@ -10,5 +10,5 @@ export function deleteOutputDir(root: string, outputPath: string) {
throw new Error('Output path MUST not be project root directory!'); throw new Error('Output path MUST not be project root directory!');
} }
removeSync(resolvedOutputPath); rmSync(resolvedOutputPath, { recursive: true, force: true });
} }