Martin Dimitrov e2da767c86
All checks were successful
Build and push image for doorman-homeassistant / docker (push) Successful in 26s
Build and push Doorman UI / API / docker (push) Successful in 1m24s
Build and push image for doorman-homeassistant / deploy-gitainer (push) Successful in 23s
migrate api to typescript
2024-12-10 21:01:55 -08:00

24 lines
632 B
TypeScript

import { readdirSync } from "node:fs";
import path from "path";
const paths = [
'./src/functions/api/door'
];
const functionFiles = paths.map(path => readdirSync(path).map(file => path + "/" + file)).flat();
// for hot reload to work, we import all the files we want to build
const imports = functionFiles.forEach(file => require('./' + path.relative('src', file)));
console.log("functions to build:", functionFiles);
console.log("Building functions...");
await Bun.build({
entrypoints: functionFiles,
outdir: './build/functions',
packages: 'external',
target: 'node',
root: './src/functions',
format: 'cjs',
});