diff --git a/copy-api.js b/copy-api.js index a41d2090..fe5862fd 100644 --- a/copy-api.js +++ b/copy-api.js @@ -5,7 +5,7 @@ import { fileURLToPath } from "url"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); -function processDir(src, dest, processFile) { +function copyDir(src, dest) { if (!fs.existsSync(src)) { console.warn(`Source directory not found: ${src}`); return; @@ -24,49 +24,13 @@ function processDir(src, dest, processFile) { const destPath = path.join(dest, entry.name); if (entry.isDirectory()) { - processDir(srcPath, destPath, processFile); + copyDir(srcPath, destPath); } else { - processFile(srcPath, destPath); + fs.copyFileSync(srcPath, destPath); } } -} -function copyFile(src, dest) { - fs.copyFileSync(src, dest); -} - -function processAndCopyFile(src, dest) { - let content = fs.readFileSync(src, "utf-8"); - - // Fix relative imports to include .ts extension for Vercel - // This helps Node.js module resolution work correctly at runtime - if (src.endsWith(".ts")) { - // Add .ts extension to relative imports if not already present - content = content.replace( - /from\s+['"](\.[^'"]*?)(?