Make babel-standalone an ESModule and enable flow (#9025)
* Make babel-standalone an ESModule and enable flow * autogenerate plugin list * Make config an array
This commit is contained in:
14
scripts/utils/writeFileAndMkDir.js
Normal file
14
scripts/utils/writeFileAndMkDir.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
module.exports = function writeFileAndMkDir(file, content) {
|
||||
try {
|
||||
fs.mkdirSync(path.dirname(file));
|
||||
} catch (error) {
|
||||
if (error.code !== "EEXIST") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
fs.writeFileSync(file, content);
|
||||
};
|
||||
Reference in New Issue
Block a user