Adds application

This commit is contained in:
Michel Fedde 2025-08-16 16:22:11 +02:00
commit b2dc69142a
12 changed files with 1683 additions and 0 deletions

17
build/build-cli.mjs Normal file
View file

@ -0,0 +1,17 @@
import * as fs from "node:fs";
if (!process.env.BUILD_TARGET) {
process.env.BUILD_TARGET = "LOCAL";
}
if (!process.env.BUILD_LABEL) {
process.env.BUILD_LABEL = "development";
}
import context from './context.mjs';
(async () => {
await context.rebuild();
await context.dispose();
})()

20
build/context.mjs Normal file
View file

@ -0,0 +1,20 @@
import * as esbuild from "esbuild";
import path from "path";
const isDev = process.env.BUILD_TARGET !== 'DOCKER';
const context = await esbuild.context({
entryPoints: [
path.join('source', 'main.ts')
],
bundle: true,
outdir: './dist/',
platform: 'node',
target: 'node10.4',
sourcemap: isDev ? 'external' : false,
loader: {
'.node': 'copy',
}
})
export default context

3
build/watch.mjs Normal file
View file

@ -0,0 +1,3 @@
import context from './context.mjs'
await context.watch();