Adds application
This commit is contained in:
commit
b2dc69142a
12 changed files with 1683 additions and 0 deletions
17
build/build-cli.mjs
Normal file
17
build/build-cli.mjs
Normal 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
20
build/context.mjs
Normal 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
3
build/watch.mjs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import context from './context.mjs'
|
||||
|
||||
await context.watch();
|
||||
Loading…
Add table
Add a link
Reference in a new issue