primevue-mirror/build-meta.js

28 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-09-14 14:49:38 +00:00
const fs = require('fs-extra');
const path = require('path');
fs.readdirSync(path.resolve(__dirname, './components/lib/'), { withFileTypes: true })
2022-09-14 14:49:38 +00:00
.filter((dir) => dir.isDirectory())
.forEach(({ name: folderName }) => {
fs.readdirSync(path.resolve(__dirname, './components/lib/' + folderName)).forEach((file) => {
2022-09-14 14:49:38 +00:00
if (file === 'package.json' || file.endsWith('d.ts') || file.endsWith('vue')) {
fs.copySync(path.resolve(__dirname, './components/lib/' + folderName) + '/' + file, 'dist/' + folderName + '/' + file);
2022-09-14 14:49:38 +00:00
}
});
});
2023-03-31 21:45:03 +00:00
fs.readdirSync(path.resolve(__dirname, './components/lib/icon/'), { withFileTypes: true })
.filter((dir) => dir.isDirectory())
.forEach(({ name: folderName }) => {
fs.readdirSync(path.resolve(__dirname, './components/lib/icon/' + folderName)).forEach((file) => {
if (file === 'package.json' || file.endsWith('d.ts') || file.endsWith('vue')) {
fs.copySync(path.resolve(__dirname, './components/lib/icon/' + folderName) + '/' + file, 'dist/icon/' + folderName + '/' + file);
}
});
});
fs.copySync(path.resolve(__dirname, './components/lib/ts-helpers.d.ts'), 'dist/ts-helpers.d.ts');
2022-09-14 14:49:38 +00:00
fs.copySync(path.resolve(__dirname, './package-build.json'), 'dist/package.json');
fs.copySync(path.resolve(__dirname, './README.md'), 'dist/README.md');
fs.copySync(path.resolve(__dirname, './LICENSE.md'), 'dist/LICENSE.md');