use find-cache-dir for babel-register cache (#5669)
This commit is contained in:
committed by
Henry Zhu
parent
925b6448e0
commit
48de6b32de
@@ -10,6 +10,7 @@
|
||||
"dependencies": {
|
||||
"babel-core": "7.0.0-alpha.9",
|
||||
"core-js": "^2.4.0",
|
||||
"find-cache-dir": "^0.1.1",
|
||||
"home-or-tmp": "^3.0.0",
|
||||
"lodash": "^4.2.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
|
||||
@@ -3,8 +3,10 @@ import fs from "fs";
|
||||
import { sync as mkdirpSync } from "mkdirp";
|
||||
import homeOrTmp from "home-or-tmp";
|
||||
import * as babel from "babel-core";
|
||||
import findCacheDir from "find-cache-dir";
|
||||
|
||||
const DEFAULT_FILENAME = path.join(homeOrTmp, `.babel.${babel.version}.${babel.getEnv()}.json`);
|
||||
const DEFAULT_CACHE_DIR = findCacheDir({ name: "babel-register" }) || homeOrTmp;
|
||||
const DEFAULT_FILENAME = path.join(DEFAULT_CACHE_DIR, `.babel.${babel.version}.${babel.getEnv()}.json`);
|
||||
const FILENAME: string = process.env.BABEL_CACHE_PATH || DEFAULT_FILENAME;
|
||||
let data: Object = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user