Skip to content

Commit

Permalink
fix(nextjs): we should not cache .next/cache/ artifact (nrwl#20658)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndcunningham authored Dec 8, 2023
1 parent 9a48349 commit 661fe4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/next/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ async function getBuildTargetConfig(
projectRoot: string,
nextConfig: NextConfig
) {
const nextOutputPath = await getOutputs(projectRoot, nextConfig);
// Set output path here so that `withNx` can pick it up.
const targetConfig: TargetConfiguration = {
command: `next build`,
Expand All @@ -126,7 +127,7 @@ async function getBuildTargetConfig(
dependsOn: ['^build'],
cache: true,
inputs: getInputs(namedInputs),
outputs: [await getOutputs(projectRoot, nextConfig)],
outputs: [nextOutputPath, `${nextOutputPath}/!(cache)`],
};
return targetConfig;
}
Expand Down

0 comments on commit 661fe4e

Please sign in to comment.