Copy API directory to root for Vercel deployment (ES module version)
cgen-19633c3bf30e48e5aae3d9b627fd0029
This commit is contained in:
parent
a69e66c93f
commit
507ee08241
1 changed files with 7 additions and 4 deletions
11
copy-api.js
11
copy-api.js
|
|
@ -1,6 +1,9 @@
|
|||
#!/usr/bin/env node
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
function copyDir(src, dest) {
|
||||
if (!fs.existsSync(src)) {
|
||||
|
|
@ -30,7 +33,7 @@ function copyDir(src, dest) {
|
|||
console.log(`Copied ${src} to ${dest}`);
|
||||
}
|
||||
|
||||
const srcApi = path.resolve(__dirname, "api");
|
||||
const destApi = path.resolve(__dirname, "..", "api");
|
||||
const srcApi = path.resolve(__dirname, 'api');
|
||||
const destApi = path.resolve(__dirname, '..', 'api');
|
||||
|
||||
copyDir(srcApi, destApi);
|
||||
|
|
|
|||
Loading…
Reference in a new issue