Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORL-1345] Disable build cache for production builds #3153

Merged
merged 1 commit into from Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/core/build/createWebpackConfig.ts
Expand Up @@ -56,6 +56,7 @@ export default function createWebpackConfig(
const isProduction = env.NODE_ENV === "production";
const minimize = isProduction && !config.get("disableMinimize");
const treeShake = config.get("enableTreeShake");
const enableBuildCache = !isProduction;

const envStringified = {
"process.env": Object.keys(env).reduce<Record<string, string>>(
Expand Down Expand Up @@ -199,7 +200,7 @@ export default function createWebpackConfig(
},
safari10: true,
},
cache: true,
cache: enableBuildCache,
parallel: true,
sourceMap: !disableSourcemaps,
}),
Expand Down Expand Up @@ -393,7 +394,7 @@ export default function createWebpackConfig(
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
cacheDirectory: enableBuildCache,
},
},
],
Expand All @@ -417,7 +418,7 @@ export default function createWebpackConfig(
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
cacheDirectory: enableBuildCache,
},
},
{
Expand Down Expand Up @@ -450,7 +451,7 @@ export default function createWebpackConfig(
{
loader: require.resolve("babel-loader"),
options: {
cacheDirectory: true,
cacheDirectory: enableBuildCache,
},
},
],
Expand Down