-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transpiling main process #15
Comments
Because Electron already supports the latest JavaScript features. |
Ah. I think I didn't understand it correctly. So you meant like having something as Babel that writes out your Electron js files in order to support a lower ES? But to have the Electron files written in Typescript to transpile; that is okay to do? It works with using the typescript built in transpiler. Just making sure that I don't do something that I shouldn't! I'm sorry if I didn't get what you meant correctly. |
Yes.
That would be the same case. |
Looking more into this, I'm not actually sure anymore why it wouldn't work when transpiled... I should have written some notes to myself about this. If it works fine for you, then great. I'll keep this open until I have time to look more into this and potentially remove that readme note. |
It works for me, so not a problem here. Thanks! |
@AidanRRR it makes sense to transpile. even if not using TS, one would use i.e. webpack to tree shake, use babel for ECMAScript stuff not available in Node (say do expressions), neatly bundle everything together. |
For production code yes, also for this devtool? |
Sure, you cannot avoid transpiling if you are using vanilla JS, but having some ECMA stage-x features that requires Babel for Node.js to be able to run the code, or even more if TS.
|
So I just ran into an issue where it is a problem. Custom webpack config with typescript and all the usual crazy module interop stuff that comes with it. Broke with a type error. |
Spent some time and it doesn't work when webpack'd because of the It works fine as far as I can tell when "transpiled" by TypeScript, although then you have to fiddle with webpack and TypeScript build tooling separately, and this increases the complexity of your whole build environment if you were relying on webpack and a TypeScript plugin loader before. I can't think of a better fix than @feljx if you want everything to build through webpack. The module needs to be run directly by node and not packed into a webpack module. |
Ticket: sindresorhus/electron-reloader#15 (comment) Might have possible workarounds
Why does it make no sense to transpile your main process files?
Just a question!
The text was updated successfully, but these errors were encountered: