diff --git a/src/utils/ncc-cache-dir.js b/src/utils/ncc-cache-dir.js index bd4fb463..10c0328f 100644 --- a/src/utils/ncc-cache-dir.js +++ b/src/utils/ncc-cache-dir.js @@ -1 +1,8 @@ -module.exports = require("os").tmpdir() + "/ncc-cache"; \ No newline at end of file +const crypto = require("crypto"); +const os = require("os"); +const path = require("path"); + +const cacheBase = process.env.XDG_CACHE_HOME || path.join(os.homedir(), ".cache"); +const projectKey = crypto.createHash("sha256").update(process.cwd()).digest("hex").slice(0, 12); + +module.exports = path.join(cacheBase, "ncc", projectKey); \ No newline at end of file