Use native Node.js functions when available (#12458)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// @flow
|
||||
|
||||
import debounce from "lodash/debounce";
|
||||
import { sync as makeDirSync } from "make-dir";
|
||||
import slash from "slash";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
@@ -17,7 +16,7 @@ const FILE_TYPE = Object.freeze({
|
||||
});
|
||||
|
||||
function outputFileSync(filePath: string, data: string | Buffer): void {
|
||||
makeDirSync(path.dirname(filePath));
|
||||
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
||||
fs.writeFileSync(filePath, data);
|
||||
}
|
||||
|
||||
@@ -163,7 +162,7 @@ export default async function ({
|
||||
util.deleteDir(cliOptions.outDir);
|
||||
}
|
||||
|
||||
makeDirSync(cliOptions.outDir);
|
||||
fs.mkdirSync(cliOptions.outDir, { recursive: true });
|
||||
|
||||
startTime = process.hrtime();
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import convertSourceMap from "convert-source-map";
|
||||
import sourceMap from "source-map";
|
||||
import slash from "slash";
|
||||
import { sync as makeDirSync } from "make-dir";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
||||
@@ -89,7 +88,7 @@ export default async function ({
|
||||
const result = buildResult(fileResults);
|
||||
|
||||
if (cliOptions.outFile) {
|
||||
makeDirSync(path.dirname(cliOptions.outFile));
|
||||
fs.mkdirSync(path.dirname(cliOptions.outFile), { recursive: true });
|
||||
|
||||
// we've requested for a sourcemap to be written to disk
|
||||
if (babelOptions.sourceMaps && babelOptions.sourceMaps !== "inline") {
|
||||
|
||||
Reference in New Issue
Block a user