2022-09-14 14:49:38 +00:00
|
|
|
const fs = require('fs-extra');
|
|
|
|
const path = require('path');
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
function copyDependencies(inFolder, outFolder, subFolder) {
|
2024-03-27 13:13:15 +00:00
|
|
|
fs.readdirSync(inFolder, { withFileTypes: true }).forEach((entry) => {
|
|
|
|
const fileName = entry.name;
|
|
|
|
const sourcePath = path.join(inFolder, fileName);
|
|
|
|
const destPath = path.join(outFolder, fileName);
|
|
|
|
|
|
|
|
if (entry.isDirectory()) {
|
|
|
|
copyDependencies(sourcePath, destPath, subFolder);
|
|
|
|
} else {
|
|
|
|
if (fileName === 'package.json' || fileName.endsWith('d.ts') || fileName.endsWith('.vue')) {
|
|
|
|
if (subFolder && sourcePath.includes(subFolder)) {
|
|
|
|
const subDestPath = path.join(outFolder, fileName.replace(subFolder, ''));
|
2023-10-02 10:46:09 +00:00
|
|
|
|
2024-03-27 13:13:15 +00:00
|
|
|
fs.ensureDirSync(path.dirname(subDestPath));
|
|
|
|
fs.copyFileSync(sourcePath, subDestPath);
|
|
|
|
} else {
|
|
|
|
fs.ensureDirSync(path.dirname(destPath));
|
|
|
|
fs.copyFileSync(sourcePath, destPath);
|
|
|
|
}
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
2024-03-27 13:13:15 +00:00
|
|
|
}
|
|
|
|
});
|
2023-04-01 01:15:53 +00:00
|
|
|
}
|
2022-09-14 14:49:38 +00:00
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
copyDependencies('./components/lib/', 'dist/', '/style');
|
2023-04-18 12:53:43 +00:00
|
|
|
copyDependencies('./components/lib/icons/', 'dist/icons/');
|
2023-08-05 01:36:07 +00:00
|
|
|
copyDependencies('./components/lib/passthrough/', 'dist/passthrough/');
|
2024-03-27 13:13:15 +00:00
|
|
|
copyDependencies('./components/lib/themes/', 'dist/themes/');
|
2023-03-31 21:45:03 +00:00
|
|
|
|
2023-03-26 05:22:57 +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');
|