babel register cache: make sure the cache file's directory exists

This commit is contained in:
jongleberry
2016-01-04 14:28:38 -08:00
parent 2516b7570f
commit 37dbf7c5ed
2 changed files with 7 additions and 4 deletions

View File

@@ -8,12 +8,13 @@
"main": "lib/node.js",
"browser": "lib/browser.js",
"dependencies": {
"babel-core": "^6.3.13",
"babel-runtime": "^5.0.0",
"core-js": "^1.0.0",
"home-or-tmp": "^1.0.0",
"path-exists": "^1.0.0",
"lodash": "^3.10.0",
"source-map-support": "^0.2.10",
"babel-core": "^6.3.13",
"babel-runtime": "^5.0.0"
"mkdirp": "^0.5.1",
"path-exists": "^1.0.0",
"source-map-support": "^0.2.10"
}
}

View File

@@ -1,5 +1,6 @@
import path from "path";
import fs from "fs";
import { sync as mkdirpSync } from "mkdirp";
import homeOrTmp from "home-or-tmp";
import pathExists from "path-exists";
@@ -22,6 +23,7 @@ export function save() {
throw err;
}
}
mkdirpSync(path.dirname(FILENAME));
fs.writeFileSync(FILENAME, serialised);
}