cleanup(bundling): replace fs-extra.removeSync() with fs.rmSync() (#15051)
This commit is contained in:
parent
bb51e98190
commit
428391e124
@ -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",
|
||||||
|
|||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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 });
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user