mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Convert to PrimeVue monorepo
This commit is contained in:
parent
970ba75b06
commit
61929eae75
4144 changed files with 59008 additions and 36177 deletions
35
packages/primevue/scripts/prebuild.mjs
Normal file
35
packages/primevue/scripts/prebuild.mjs
Normal file
|
@ -0,0 +1,35 @@
|
|||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import { removeBuild, resolvePath, updatePackageJson } from '../../../scripts/build-helper.mjs';
|
||||
|
||||
removeBuild(import.meta.url);
|
||||
|
||||
const { __dirname, INPUT_DIR } = resolvePath(import.meta.url);
|
||||
const __root = path.resolve(__dirname, '../');
|
||||
const pkg = path.resolve(__root, './package.json');
|
||||
|
||||
updatePackageJson(pkg);
|
||||
|
||||
// update package.json > "exports" for local
|
||||
let exports = {};
|
||||
|
||||
fs.readdirSync(path.resolve(__root, INPUT_DIR), { withFileTypes: true })
|
||||
.filter((dir) => dir.isDirectory())
|
||||
.forEach(({ name: folderName }) => {
|
||||
fs.readdirSync(path.resolve(__root, INPUT_DIR + folderName)).forEach((file) => {
|
||||
let fileName = file.split(/(.vue)$|(.js)$/)[0];
|
||||
let name = fileName.toLowerCase();
|
||||
|
||||
if (name === folderName) {
|
||||
exports[`./${folderName}`] = `./${INPUT_DIR}${folderName}/${file}`;
|
||||
exports[`./${folderName}/style`] = `./${INPUT_DIR}${folderName}/style/${fileName}Style.js`;
|
||||
}
|
||||
});
|
||||
});
|
||||
exports['./*'] = './*';
|
||||
|
||||
const pkgJson = JSON.parse(fs.readFileSync(pkg, { encoding: 'utf8', flag: 'r' }));
|
||||
|
||||
pkgJson.exports = exports;
|
||||
|
||||
fs.writeFileSync(pkg, JSON.stringify(pkgJson, null, 4));
|
Loading…
Add table
Add a link
Reference in a new issue