Skip to content

Commit

Permalink
fix(nextjs): src package.json should not be copied to output folder
Browse files Browse the repository at this point in the history
closes: #21535
  • Loading branch information
ndcunningham authored and meeroslav committed Feb 8, 2024
1 parent 202f141 commit aa622ba
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/next/src/executors/build/lib/create-next-config-file.ts
Expand Up @@ -77,10 +77,13 @@ export function createNextConfigFile(
);
for (const moduleFile of moduleFilesToCopy) {
ensureDirSync(dirname(join(context.root, options.outputPath, moduleFile)));
copyFileSync(
join(context.root, projectRoot, moduleFile),
join(context.root, options.outputPath, moduleFile)
);
// We already generate a build version of package.json in the dist folder.
if (moduleFile !== 'package.json') {
copyFileSync(
join(context.root, projectRoot, moduleFile),
join(context.root, options.outputPath, moduleFile)
);
}
}
}

Expand Down

0 comments on commit aa622ba

Please sign in to comment.