fix(nextjs): src package.json should not be copied to output folder

closes: #21535
This commit is contained in:
Nicholas Cunningham 2024-02-07 16:16:39 -07:00 committed by Miroslav Jonaš
parent 202f141778
commit aa622bab5a

View File

@ -77,11 +77,14 @@ export function createNextConfigFile(
); );
for (const moduleFile of moduleFilesToCopy) { for (const moduleFile of moduleFilesToCopy) {
ensureDirSync(dirname(join(context.root, options.outputPath, moduleFile))); ensureDirSync(dirname(join(context.root, options.outputPath, moduleFile)));
// We already generate a build version of package.json in the dist folder.
if (moduleFile !== 'package.json') {
copyFileSync( copyFileSync(
join(context.root, projectRoot, moduleFile), join(context.root, projectRoot, moduleFile),
join(context.root, options.outputPath, moduleFile) join(context.root, options.outputPath, moduleFile)
); );
} }
}
} }
function readSource(getFile: () => string): { file: string; content: string } { function readSource(getFile: () => string): { file: string; content: string } {