From 2f6f833549a034b7dc93b4bf2746ad7b8107223b Mon Sep 17 00:00:00 2001 From: Flummi Date: Sat, 15 Mar 2025 16:26:59 +0100 Subject: [PATCH] Aktualisiere Importe auf Node.js-Module und passe .gitignore an --- .gitignore | 3 ++- src/index.ts | 8 ++++---- src/router.ts | 6 +++--- src/template.ts | 4 ++-- tsconfig.json | 3 ++- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 7608aab..16acd49 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -package-log.json +dist +package-lock.json diff --git a/src/index.ts b/src/index.ts index 4536abc..7d39b48 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ -import http, { IncomingMessage, ServerResponse } from "http"; -import { URL } from "url"; -import { Buffer } from "buffer"; -import querystring from "querystring"; +import http, { IncomingMessage, ServerResponse } from "node:http"; +import { URL } from "node:url"; +import { Buffer } from "node:buffer"; +import querystring from "node:querystring"; import Router from "./router.js"; import Tpl from "./template.js"; diff --git a/src/router.ts b/src/router.ts index 0b4dd47..d74ba5f 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,9 +1,9 @@ -import fs from "fs"; -import path from "path"; +import fs from "node:fs"; +import path from "node:path"; import Tpl from "./template.js"; import { Request } from "./index.js"; -import { ServerResponse } from "http"; +import { ServerResponse } from "node:http"; type RouteCallback = (req: Request, res: ServerResponse) => void; diff --git a/src/template.ts b/src/template.ts index 9a4c49d..eadfd06 100644 --- a/src/template.ts +++ b/src/template.ts @@ -1,5 +1,5 @@ -import fs from "fs"; -import path from "path"; +import fs from "node:fs"; +import path from "node:path"; export default class Template { private views: string; diff --git a/tsconfig.json b/tsconfig.json index 8c1d3f7..aba885c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,8 @@ "outDir": "./dist", "rootDir": "./src", "strict": true, - "esModuleInterop": true + "esModuleInterop": true, + "removeComments": true }, "include": ["src"], "exclude": ["node_modules"]