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:
+1
-3
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"target": "ES2020",
|
||||||
"module": "ES2020",
|
"module": "none",
|
||||||
"lib": ["ES2020", "DOM"],
|
"lib": ["ES2020", "DOM"],
|
||||||
"outDir": "./web/static",
|
"outDir": "./web/static",
|
||||||
"rootDir": "./web/src",
|
"rootDir": "./web/src",
|
||||||
@@ -9,8 +9,6 @@
|
|||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"moduleResolution": "node",
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"declaration": false,
|
"declaration": false,
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user