Copy all API files for Vercel
cgen-5f29aa0e480046de8e53d13df8117456
This commit is contained in:
parent
abb4bbe81e
commit
a8a93b9559
1 changed files with 3 additions and 14 deletions
17
build-api.js
17
build-api.js
|
|
@ -10,15 +10,6 @@ console.log("Preparing API files for Vercel...");
|
|||
const srcApi = path.resolve(__dirname, "api");
|
||||
const destApi = path.resolve(__dirname, "..", "api");
|
||||
|
||||
// Files to exclude from API directory (utilities that shouldn't be handlers)
|
||||
const excludeFiles = new Set([
|
||||
"_supabase.ts",
|
||||
"_cors.ts",
|
||||
"_notifications.ts",
|
||||
"opportunities.ts",
|
||||
"applications.ts",
|
||||
]);
|
||||
|
||||
function copyDir(src, dest) {
|
||||
if (fs.existsSync(dest)) {
|
||||
fs.rmSync(dest, { recursive: true, force: true });
|
||||
|
|
@ -32,15 +23,13 @@ function copyDir(src, dest) {
|
|||
|
||||
if (entry.isDirectory()) {
|
||||
copyDir(srcPath, destPath);
|
||||
} else if (!entry.name.startsWith(".") && !excludeFiles.has(entry.name)) {
|
||||
} else if (!entry.name.startsWith(".")) {
|
||||
fs.copyFileSync(srcPath, destPath);
|
||||
console.log(` Copied: ${entry.name}`);
|
||||
} else if (excludeFiles.has(entry.name)) {
|
||||
console.log(` Skipped (utility): ${entry.name}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Copying API files from ${srcApi}...`);
|
||||
copyDir(srcApi, destApi);
|
||||
console.log(`✓ API files prepared for Vercel`);
|
||||
console.log(`✓ Copied to ${destApi}`);
|
||||
console.log("Vercel will compile and serve TypeScript files.");
|
||||
|
|
|
|||
Loading…
Reference in a new issue