From 37c1c4e8ae48b00bf37f7afb7d07d60ea26b232d Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Sun, 19 Nov 2023 20:38:51 +0100 Subject: [PATCH] Set es2022 globally but force CommonJS when using ts-node for scripts --- package.json | 2 +- tsconfig.json | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6accd52be1..d36cc938fa 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js", "build:bundle": "webpack --progress --mode production", "build:bundle-stats": "webpack --progress --mode production --json > webpack-stats.json", - "build:module_system": "tsc --project ./tsconfig.module_system.json && node ./lib/module_system/scripts/install.js", + "build:module_system": "ts-node --project ./tsconfig.module_system.json module_system/scripts/install.ts", "dist": "scripts/package.sh", "start": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n modules,res,jitsi \"yarn build:module_system\" \"yarn build:res\" \"yarn build:jitsi\" && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"", "start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js --https\"", diff --git a/tsconfig.json b/tsconfig.json index 03cc0c3123..d19b111e15 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "emitDecoratorMetadata": false, "resolveJsonModule": true, "esModuleInterop": true, - "module": "commonjs", + "module": "es2022", "moduleResolution": "node", "target": "es2016", "noUnusedLocals": true, @@ -28,6 +28,9 @@ "./scripts/*.ts" ], "ts-node": { - "files": true + "files": true, + "moduleTypes": { + "*": "cjs" + } } }