fix(vite): build executor should not overwrite package.json in dist (#16586)
This commit is contained in:
parent
e4aad48125
commit
2d78de5e1e
@ -35,9 +35,11 @@ export async function* viteBuildExecutor(
|
|||||||
|
|
||||||
const libraryPackageJson = resolve(projectRoot, 'package.json');
|
const libraryPackageJson = resolve(projectRoot, 'package.json');
|
||||||
const rootPackageJson = resolve(context.root, '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.
|
// For buildable libs, copy package.json if it exists.
|
||||||
if (
|
if (
|
||||||
|
!existsSync(distPackageJson) &&
|
||||||
existsSync(libraryPackageJson) &&
|
existsSync(libraryPackageJson) &&
|
||||||
rootPackageJson !== libraryPackageJson
|
rootPackageJson !== libraryPackageJson
|
||||||
) {
|
) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user