fix: configure TypeScript for non-module browser scripts

- Change module setting from 'ES2020' to 'none'
- Remove resolveJsonModule and moduleResolution options (incompatible with module: none)
- Prevents TypeScript from adding 'export {}' statements to compiled JS
- Scripts are loaded as regular JavaScript, not ES modules
- Fixes 'Unexpected token export' error in browser

This allows TypeScript type checking while generating plain JavaScript
that works with traditional script tags in HTML.
This commit is contained in:
2026-01-29 14:52:43 -05:00
parent b887c38abf
commit 95d78158aa
+1 -3
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2020",
"module": "none",
"lib": ["ES2020", "DOM"],
"outDir": "./web/static",
"rootDir": "./web/src",
@@ -9,8 +9,6 @@
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"declaration": false,
"sourceMap": false,
"noUnusedLocals": true,