Open basz opened 1 year ago
@basz I use TypeScript for the Ember side, but not the Electron side.
yeah. now i know why... pita... anyway a bit further
added this to the root tsconfig.json
"target": "ES2020",
"module": "commonjs",
App compiles, and starts. I see a window with
Compiled with problems:
×
ERROR
Module not found: Error: Can't resolve './src/renderer.ts' in '/path/to/app'
Soo it loads the main entry point. Feel like I am really close...
Yes. I now have the template typescript app running as an ember-electron application! Runs as yarn electron-forge start
and as ember electron
trick was to use __dirname inside the forge.config.ts
entryPoints: [
{
html: __dirname + '/src/index.html',
js: __dirname + '/src/renderer.ts',
name: 'main_window',
preload: {
js: __dirname + '/src/preload.ts',
},
},
],
@basz this is awesome! I've long wanted to figure out how to start writing main process code in typescript. Thanks so much for pioneering! Would you be willing to write up some documentation, like a little how-to or something? I'm happy to support in any way.
Yes! Ping me if I forget
not sure if that setup is complete. Although it runs with typescript it is also webpack'ed. That is a whole new beast to configure. The "old" method of loading file://path/to/app/emebr-dist/index.html' seems to work, but the template starter actually uses real url's
http://localhost:3000/main_window`. These should have the ember app packed into it I'm guessing. Unfortunately I don't know how to to that properly :-/
@bendemboski any thoughts?
Sorry, I don't really, I haven't had a chance to dig into this at all
for any one that needs a starting point. https://github.com/basz/ember-electron-app/
@basz is this something you could write up in our official documentation perhaps?
Ai. That's been while. Not sure if I can afford the time to dig back into the intricacies. Sorry.
Hi,
I have an working application that I want to convert to typescript.
Looking at https://github.com/electron/forge there is a typescript template that indeed runs when being a stand alone electron app.
However in ember-electron this does not seem to work... I think becuase ember-electron run forge via its 'api' and therefore uses ts config from the enclosing ember app.
This works
But this will fail;
Is this even possible? Perhaps any example repositories?