fix(vite): build executor should not overwrite package.json in dist (#16586)

This commit is contained in:
Dmitriy Stepanenko 2023-04-26 22:16:03 +03:00 committed by GitHub
parent e4aad48125
commit 2d78de5e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,9 +35,11 @@ export async function* viteBuildExecutor(
const libraryPackageJson = resolve(projectRoot, 'package.json');
const rootPackageJson = resolve(context.root, 'package.json');
const distPackageJson = resolve(normalizedOptions.outputPath, 'package.json');
// For buildable libs, copy package.json if it exists.
if (
!existsSync(distPackageJson) &&
existsSync(libraryPackageJson) &&
rootPackageJson !== libraryPackageJson
) {