From f1c73857ddd7fdcb576b86f97b6785635ca7869f Mon Sep 17 00:00:00 2001 From: gusthoff Date: Sat, 2 Nov 2024 23:06:19 +0100 Subject: [PATCH] Widget: update to Node.js ESM (ECMAScript Modules) --- frontend/.mocharc.json | 5 +++++ frontend/package.json | 1 + frontend/tsconfig.json | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/.mocharc.json b/frontend/.mocharc.json index 0773558c4..3950d9cae 100644 --- a/frontend/.mocharc.json +++ b/frontend/.mocharc.json @@ -12,5 +12,10 @@ "ts-node/register", "jsdom-global/register" ], + "node-option": [ + "disable-warning=ExperimentalWarning", + "experimental-specifier-resolution=node", + "loader=ts-node/esm" + ], "spec": "tests/**/*.spec.ts" } diff --git a/frontend/package.json b/frontend/package.json index 73f42fed4..7782ad525 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,7 @@ { "name": "learn", "version": "1.0.0", + "type": "module", "description": "", "private": true, "dependencies": { diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index b4cdf0a7a..7bfe8ee2a 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -4,13 +4,13 @@ "allowImportingTsExtensions": true, "sourceMap": true, "allowJs": true, - "target": "es2022", "esModuleInterop": true, "downlevelIteration": true, "strict": true, - "lib": ["es2022"], - "module": "CommonJS", - "moduleResolution": "node" + "lib": ["es2023"], + "module": "node16", + "target": "es2022", + "moduleResolution": "node16" }, "include": [ "./src/**/*"