ts-node support. debugging is slightly wonky as vscode will not allow breakpoints in modules that aren't bundle, yet.

This commit is contained in:
Maddy
2022-01-01 01:15:13 +11:00
parent f1b0d552b6
commit 7820f586b2
4 changed files with 41 additions and 6 deletions
+4 -1
View File
@@ -1,6 +1,9 @@
import { Server, traverseDirectory } from "lambert-server";
const DEFAULT_FILTER = /^([^\.].*)(?<!\.d)\.(js)$/;
//if we're using ts-node, use ts files instead of js
const extension = Symbol.for("ts-node.register.instance") in process ? "ts" : "js"
const DEFAULT_FILTER = new RegExp("^([^\.].*)(?<!\.d)\.(" + extension + ")$");
export function registerRoutes(server: Server, root: string) {
return traverseDirectory(