-
Notifications
You must be signed in to change notification settings - Fork 97
Why electron-compile is required for production #207
Comments
@develar If there is a comprehensive approach on converting or moving |
@develar
As for the unused dependencies,
This warning is just straight up wrong, |
Then there seems to be a conflict here, as ⚠️ Package "electron-compile" should be in "devDependencies".
Please remove it from the "dependencies" section in your package.json.
Please see https://github.com/electron/electron-compile/issues/207 However, following this approach results in production builds missing |
@sidneys Not a conflict, a misunderstanding of the requirements of |
@MarshallOfSound for what we need electron-compile and shim if all files were transpiled? Electron-builder uses electron-compile to compile all files in place. |
@sidneys readme is clear — shim is required only if you select ”How does it work? (Slightly Harder Way“ If you will you use easy way — special electron prebuilt with electron-complie, shim not required in both dev and production modes. I don't see any reason why electron-compile is required for production — so, I have opened this ticket to clear it. |
Yes, I read sources, compiler just throw error if no file in the cache. But it doesn't related to IO performance since asar is used. It just adds unnecessary dependency and checks. |
Short summary from private talk with @MarshallOfSound to avoid misunderstandings — electron-builder doesn't attempt to support electron-compile in a different way or somehow contradicts to. Currently it is implemented in this way (and warn printed) only because original question in this issue is not answered yet. Nothing more. electron-builder just want to provide the best experience for users and have the answer to question like "I had exactly the same problem where this shim was used in production build. I switched to pure babel pre-compilation since then and never looked back." (electron-userland/electron-builder#807 (comment)). |
@develar While I guess technically you're correct, you could use electron-compiler to just pre-compile everything in-place, electron-compile in production is actually less I/O than pre-compiling because electron-compile GZips everything in its cache. It also prevents your app from loading file:// content you didn't precompile, which is an important security mitigation. That being said, I guess there's nothing stopping you from doing so, though I think you'll have a better experience if you use electron-compile as-designed |
because CPU to ungzip is cheeper than read data from disk (asar file)? Interesting, thanks.
👍 Thanks for answer. Now all is clear. |
@paulcbetts @MarshallOfSound Another question — why source directory is still included? |
👍 I have filed #209 |
I'm facing the same question as @develar even though from another viewpoint , do i really need The project which i'm working on currently has 3 packages (vue, vuex, electon-edge-js,) besides the 68 that come with electron-compile, could there not be a |
Hi. I supported electron-compile in the electron-builder, but what I don't understand it is why we need
es6-shim.js
andelectron-compile
dependency in the runtime.If all files were transpiled, for what we need to use shim?
Also,
electron-compile
has some deps that are not required for production — e.g.yargs
/spawn-rx
.The text was updated successfully, but these errors were encountered: