diff --git a/lib/util/utils.ts b/lib/util/utils.ts index b971bc3e0..086e3c17f 100644 --- a/lib/util/utils.ts +++ b/lib/util/utils.ts @@ -51,7 +51,7 @@ function capitalize(s: string): string { } async function getZigbee2MQTTVersion(includeCommitHash = true): Promise<{commitHash?: string; version: string}> { - const packageJSON = await import('../../package.json'); + const packageJSON = (await import('../../package.json', {with: {type: 'json'}})).default; const version = packageJSON.version; let commitHash: string | undefined; diff --git a/package.json b/package.json index fd1c7e6af..f9f98e7e4 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ ], "scripts": { "build": "tsc && node index.js writehash", - "build-watch": "tsc --watch", + "build:watch": "tsc --watch", "eslint": "eslint --max-warnings=0", "pretty:write": "prettier --write .", "pretty:check": "prettier --check .", diff --git a/tsconfig.json b/tsconfig.json index 27f73c8f7..8a4ee1261 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,13 @@ { "compilerOptions": { "allowSyntheticDefaultImports": true, - "module": "commonjs", + "module": "Node16", "esModuleInterop": true, "target": "ES2022", "lib": ["ES2022"], "strict": true, "noImplicitAny": true, "noImplicitThis": true, - "moduleResolution": "node", "declaration": true, "declarationMap": true, "outDir": "dist",