digital.solutions.test/back/scripts/build.js

14 lines
395 B
JavaScript
Raw Permalink Normal View History

2024-11-09 16:01:54 +01:00
import esbuild from 'esbuild';
import fsp from 'node:fs/promises';
fsp.rm('dist', { recursive: true, force: true });
fsp.mkdir('dist', { recursive: true });
const src = await fsp.readdir('src', { recursive: true });
const filtered = src.filter(x => x.endsWith('.ts')).map(x => 'src/' + x);
await esbuild.build({
entryPoints: filtered,
outdir: 'dist',
tsconfig: 'tsconfig.json'
});