Files
nats-console/apps/api/build.mjs
T
Fizer Khan a9f2ca31d7 fix build issues.
add support for invite members.
update new invite accept and success page.
2025-12-06 16:47:24 +05:30

34 lines
804 B
JavaScript

import * as esbuild from 'esbuild';
import { readdir, stat } from 'node:fs/promises';
import { join } from 'node:path';
// Recursively get all TypeScript files
async function getFiles(dir) {
const entries = await readdir(dir, { withFileTypes: true });
const files = await Promise.all(entries.map(async (entry) => {
const path = join(dir, entry.name);
if (entry.isDirectory()) {
return getFiles(path);
} else if (entry.name.endsWith('.ts')) {
return path;
}
return [];
}));
return files.flat();
}
const entryPoints = await getFiles('src');
await esbuild.build({
entryPoints,
outdir: 'dist',
bundle: false,
platform: 'node',
target: 'node20',
format: 'esm',
sourcemap: true,
packages: 'external',
});
console.log('Build completed successfully');