From 60583aa658564be67b7946915826b858ce9e5aae Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 17 Jan 2023 02:00:57 +0100 Subject: [PATCH] Configuration with more or less working scripts --- package.json | 1 - scripts/GenerateSeries.ts | 2 +- tsconfig.json | 9 +++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 87153487b..deada89cb 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "bugs": "https://github.com/pietervdvn/MapComplete/issues", "homepage": "https://mapcomplete.osm.be", "main": "index.js", - "type": "module", "scripts": { "vitedev": "vite", "vitebuild": "tsc && vite build", diff --git a/scripts/GenerateSeries.ts b/scripts/GenerateSeries.ts index 9fe6ebd61..c1761f102 100644 --- a/scripts/GenerateSeries.ts +++ b/scripts/GenerateSeries.ts @@ -56,7 +56,7 @@ class StatsDownloader { }.day.json` writtenFiles.push(path) if (existsSync(path)) { - let features = JSON.parse(readFileSync(path, "UTF-8")) + let features = JSON.parse(readFileSync(path, { encoding: "utf-8" })) features = features?.features ?? features features.push(...features.features) // day-stats are generally a list already, but in some ad-hoc cases might be a geojson-collection too console.log( diff --git a/tsconfig.json b/tsconfig.json index 5652a3024..f6b187e0e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,5 +15,14 @@ // "noImplicitReturns": true, "skipLibCheck": true }, + "ts-node": { + "compilerOptions": { + "isolatedModules": false, + "esModuleInterop": true, + "moduleResolution": "node", + "target": "ES5", + "module": "CommonJS" + } + }, "exclude": ["node_modules", "test", "scripts"] }