chore: remove output-file-sync dependency (#10619)

This commit is contained in:
Huáng Jùnliàng 2019-10-31 14:51:36 -04:00 committed by Brian Ng
parent 0b0edc3e3d
commit a2b5437b01
5 changed files with 18 additions and 5 deletions

View File

@ -25,7 +25,6 @@
"glob": "^7.0.0",
"lodash": "^4.17.13",
"make-dir": "^2.1.0",
"output-file-sync": "^2.0.0",
"slash": "^2.0.0",
"source-map": "^0.5.0"
},

View File

@ -1,7 +1,6 @@
// @flow
import defaults from "lodash/defaults";
import outputFileSync from "output-file-sync";
import { sync as makeDirSync } from "make-dir";
import slash from "slash";
import path from "path";
@ -10,6 +9,11 @@ import fs from "fs";
import * as util from "./util";
import { type CmdOptions } from "./options";
function outputFileSync(filePath: string, data: string | Buffer): void {
makeDirSync(path.dirname(filePath));
fs.writeFileSync(filePath, data);
}
export default async function({
cliOptions,
babelOptions,

View File

@ -1,7 +1,7 @@
const readdir = require("fs-readdir-recursive");
const helper = require("@babel/helper-fixtures");
const rimraf = require("rimraf");
const outputFileSync = require("output-file-sync");
const { sync: makeDirSync } = require("make-dir");
const child = require("child_process");
const merge = require("lodash/merge");
const path = require("path");
@ -14,6 +14,11 @@ const fileFilter = function(x) {
return x !== ".DS_Store";
};
const outputFileSync = function(filePath, data) {
makeDirSync(path.dirname(filePath));
fs.writeFileSync(filePath, data);
};
const presetLocs = [path.join(__dirname, "../../babel-preset-react")];
const pluginLocs = [

View File

@ -34,7 +34,7 @@
"@babel/core": "^7.6.3",
"@babel/helper-fixtures": "^7.6.3",
"fs-readdir-recursive": "^1.0.0",
"output-file-sync": "^2.0.0"
"make-dir": "^2.1.0"
},
"bin": {
"babel-node": "./bin/babel-node.js"

View File

@ -2,7 +2,7 @@ const includes = require("lodash/includes");
const readdir = require("fs-readdir-recursive");
const helper = require("@babel/helper-fixtures");
const rimraf = require("rimraf");
const outputFileSync = require("output-file-sync");
const { sync: makeDirSync } = require("make-dir");
const child = require("child_process");
const merge = require("lodash/merge");
const path = require("path");
@ -15,6 +15,11 @@ const fileFilter = function(x) {
return x !== ".DS_Store";
};
const outputFileSync = function(filePath, data) {
makeDirSync(path.dirname(filePath));
fs.writeFileSync(filePath, data);
};
const presetLocs = [
path.join(__dirname, "../../babel-preset-env"),
path.join(__dirname, "../../babel-preset-react"),