In the browser this works:
import blah from "../blah.js";
but if you don't specify the extension it doesnt:
import blah from "../blah";
errors with
I'm using typescript in an electron project. I can't get typescript to emit the correct code.
my package.json has this
"type": "commonjs"
because this is an electron project and else it wouldn't work.
this is my tsconfig.json:
{
"compilerOptions": {
"baseUrl": "src",
"strict": true,
"target": "ESNext",
"outDir": "build/",
"sourceMap": true,
"moduleResolution": "node16",
"module": "ESNext",
"esModuleInterop": false
},
"exclude": [
"node_modules/",
"build/",
"tests"
]
}
If some values don't make sense that's because I've been testing options to see if anything works.
Additionally I'm using swc to compile it but tsc doesn't emit the correct code either.