primevue-mirror/build-meta.js

33 lines
1.6 KiB
JavaScript
Raw Permalink Normal View History

2022-09-14 14:49:38 +00:00
const fs = require('fs-extra');
const path = require('path');
function copyDependencies(inFolder, outFolder, subFolder) {
2023-04-01 01:15:53 +00:00
fs.readdirSync(path.resolve(__dirname, inFolder), { withFileTypes: true })
.filter((dir) => dir.isDirectory())
.forEach(({ name: folderName }) => {
fs.readdirSync(path.resolve(__dirname, inFolder + folderName)).forEach((file) => {
if (file === 'package.json' || file.endsWith('d.ts') || file.endsWith('vue')) {
fs.copySync(path.resolve(__dirname, inFolder + folderName) + '/' + file, outFolder + folderName + '/' + file);
}
});
if (subFolder) {
try {
fs.readdirSync(path.resolve(__dirname, inFolder + folderName + subFolder)).forEach((subFile) => {
if (subFile === 'package.json' || subFile.endsWith('d.ts') || subFile.endsWith('vue')) {
fs.copySync(path.resolve(__dirname, inFolder + folderName + subFolder) + '/' + subFile, outFolder + folderName + subFolder + '/' + subFile);
}
});
} catch {}
}
2022-09-14 14:49:38 +00:00
});
2023-04-01 01:15:53 +00:00
}
2022-09-14 14:49:38 +00:00
copyDependencies('./components/lib/', 'dist/', '/style');
copyDependencies('./components/lib/icons/', 'dist/icons/');
2023-08-05 01:36:07 +00:00
copyDependencies('./components/lib/passthrough/', 'dist/passthrough/');
2023-03-31 21:45:03 +00:00
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, './README.md'), 'dist/README.md');
fs.copySync(path.resolve(__dirname, './LICENSE.md'), 'dist/LICENSE.md');