From 3884864d300cb15253158612bd9f0239036d626a Mon Sep 17 00:00:00 2001 From: Matteo Rosati Date: Wed, 11 Feb 2026 15:34:53 +0100 Subject: [PATCH] setup ts --- build.js | 2 +- bun.lock | 1 + frontend/static/frontend/ts/main.ts | 18 ++++++++++++++++++ frontend/templates/frontend/home.html | 2 +- package.json | 3 ++- tsconfig.json | 12 ++++++++++++ 6 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 tsconfig.json diff --git a/build.js b/build.js index 92664af..9025b1e 100644 --- a/build.js +++ b/build.js @@ -6,7 +6,7 @@ const isDev = process.argv.includes("--dev"); const config = { entryPoints: ["frontend/static/frontend/ts/main.ts"], // il tuo entry point bundle: true, - outdir: "frontend/static/frontend/dist", + outdir: "frontend/static/frontend/dist/js", format: "iife", // o 'iife' se serve per un tag + {% endblock %} diff --git a/package.json b/package.json index 072d4f5..a3f6404 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { "dependencies": { "@types/maplibre-gl": "^1.14.0", - "esbuild": "^0.27.3" + "esbuild": "^0.27.3", + "maplibre-gl": "^5.18.0" }, "scripts": { "dev": "bun run build.js --dev", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e8024b8 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "types": ["maplibre-gl"], + "lib": ["ES2020", "DOM"], + "noEmit": true + }, + "include": ["frontend/static/frontend/ts/**/*.ts"] +}