Skip to content

Commit

Permalink
fix(api): don't share cache root between environments
Browse files Browse the repository at this point in the history
  • Loading branch information
wessberg committed Oct 22, 2020
1 parent 80e9433 commit 1262d65
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/constant/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import {environment} from "../environment/environment";
import tempDirectory from "temp-dir";
import {join} from "path";
import {ALL_CONTEXTS, WINDOW_CONTEXT, WINDOW_NODE_CONTEXT} from "../polyfill/polyfill-context";
import {booleanize} from "../util/booleanize/booleanize";

const tempRoot = join(
tempDirectory,
environment.NPM_PACKAGE_NAME,
process.env.PRODUCTION != null && (process.env.PRODUCTION === "" || booleanize(process.env.PRODUCTION)) ? "production" : "development"
);

export const constant: IConstant = {
endpoint: {
Expand All @@ -20,8 +27,8 @@ export const constant: IConstant = {
},

path: {
cacheRoot: join(tempDirectory, environment.NPM_PACKAGE_NAME),
cachePackageVersionMap: join(tempDirectory, environment.NPM_PACKAGE_NAME, "cache_package_version_map.json")
cacheRoot: join(tempRoot),
cachePackageVersionMap: join(tempRoot, "cache_package_version_map.json")
},

polyfill: {
Expand Down

0 comments on commit 1262d65

Please sign in to comment.