primevue-mirror/apps/showcase/scripts/prebuild.js

21 lines
733 B
JavaScript
Raw Normal View History

2024-06-11 12:21:12 +00:00
const fs = require('fs');
const path = require('path');
const rootDir = path.resolve(__dirname, '../');
const workspaceDir = path.resolve(__dirname, '../../../');
const pkg = path.resolve(rootDir, 'package.json');
const pkgJson = require(pkg);
const packageJson = require(path.resolve(workspaceDir, 'package.json'));
pkgJson.version = packageJson.version;
pkgJson.author = packageJson.author;
pkgJson.homepage = packageJson.homepage;
pkgJson.license = packageJson.license;
pkgJson.repository = { ...pkgJson.repository, ...packageJson.repository };
pkgJson.bugs = { ...pkgJson.bugs, ...packageJson.bugs };
pkgJson.engines = { ...pkgJson.engines, ...packageJson.engines };
fs.writeFileSync(pkg, JSON.stringify(pkgJson, null, 4));