Forgive the simplicity of my plaintiff question, I'm close to my wits end.
I am looking for a working simple example of Electron v8 and TypeScript. It needn't include WebPack, Babel, React or anything else. Nothing I have found seems to work with Electron v8.
Update
My prior statement remind me of Macbeth's line it is a tale Told by an idiot, full of sound and fury, Signifying nothing, so let's state the problem in detail this time.
The stock Electron & Typescript example does not demonstrate the following:
- Using
importfor Node modules within the renderer process - Using
importfor my own application modules within the renderer process.
Attempting to do so got no errors from tsc but provoked a runtime error
ReferenceError: exports is not defined[Learn More]
exports.__esModule = true
Using require instead of import, especially for classes like EventEmitter upset VS Code which warned
'EventEmitter' refers to a value, but is being used as a type here.ts(2749)
... so that's a backward step.
Setting target in tsconfig.json to ES2018 means I can use ES6 modules and the import syntax for my own modules, though it needs a .js suffix to work.
import {blah} from './MyModule.js'` // Shouldn't need that suffix!
VS Code gives the impression that I can import Node modules, but it still fails at runtime.
Uncaught TypeError: Failed to resolve module specifier "events". Relative references must start with either "/", "./", or "../".