Skip to content

Commit

Permalink
use find-cache-dir for babel-register cache (babel#5669)
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Williams authored and hzoo committed Apr 27, 2017
1 parent 925b644 commit 48de6b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/babel-register/package.json
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion packages/babel-register/src/cache.js
Expand Up @@ -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 = {};

Expand Down

0 comments on commit 48de6b3

Please sign in to comment.