[babel 8] Remove make-dir polyfill for fs.mkdirSync (#13828)

* [babel 8] Remove `make-dir` polyfill for `fs.makeDitSync`

* `yarn`

* fix

* Inject polyfills in jest tests when needed
This commit is contained in:
Nicolò Ribaudo
2021-10-11 07:01:30 +02:00
committed by GitHub
parent 49a0d65be1
commit 6880898510
8 changed files with 24 additions and 15 deletions

View File

@@ -28,7 +28,7 @@
"convert-source-map": "^1.1.0",
"fs-readdir-recursive": "^1.1.0",
"glob": "^7.0.0",
"make-dir": "^2.1.0",
"make-dir": "condition:BABEL_8_BREAKING ? : ^2.1.0",
"slash": "condition:BABEL_8_BREAKING ? ^3.0.0 : ^2.0.0",
"source-map": "^0.5.0"
},

View File

@@ -1,7 +1,6 @@
import readdir from "fs-readdir-recursive";
import * as helper from "@babel/helper-fixtures";
import rimraf from "rimraf";
import { sync as makeDirSync } from "make-dir";
import child from "child_process";
import path from "path";
import fs from "fs";
@@ -22,7 +21,7 @@ const fileFilter = function (x) {
};
const outputFileSync = function (filePath, data) {
makeDirSync(path.dirname(filePath));
fs.mkdirSync(path.dirname(filePath), { recursive: true });
fs.writeFileSync(filePath, data);
};