How do you reference a typescript file in an Electron app?
See original GitHub issue- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project follows, as appropriate.
- I have searched the issue tracker for an issue that matches the one I want to file, without success.
Please describe your issue:
Could someone help me to setup a blank Electron project to use TypeScript and nothing else?
The React + TypeScript template is almost exactly what I would like however I don’t understand one piece of this template.
I removed all the React parts (since I will not be using it) but that leaves me with the one html file and one index.ts file. The index.ts file starts up the Main thread used by electron which is great, but I also want to write all my Renderer thread code in TypeScript too.
The part that I don’t understand is how do I add my Renderer.ts file to the mix? I need the TypeScript compiler to compile this (and additional files) and I need to somehow access this code in the index.html file. I’m not sure how electron-forge knows which typescript files to compile, and I do not understand where the compiled files get placed. How do I access Renderer.ts in the html file?
Console output when you run electron-forge
with the environment variable DEBUG=electron-forge:*
. (Instructions on how to do so here). Please include the stack trace if one exists.
Put the console output here
What command line arguments are you passing?
Put the arguments here
What does your config.forge
data in package.json
look like?
Paste the config.forge JSON object here
Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init
is a good starting point, if that is not the
source of your problem.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
FWIW Webpack support will be in Electron Forge v6.
I’m giving ip on Electron-forge as well. It should make everything easy so you could focus on building your app. Not! spent 2 days on trying to get the app to load static content like images from html using webpack, and no luck. The documentation is so lousy, everything is described so briefly, like you should know everything yourself… So really, it does only complicate things a lot!