meteor-desktop
meteor-desktop copied to clipboard
After building the desktop app, Meteor.isDevelopment is still true.
So in order to build the desktop app, you first need to start the meteor server. Then run build and it will grab the mobile package from the running server as specified in the docs. But the server is running in development mode so Meteor.isDevelopment is true, and is also true for the final built production app.
We should probably run the server with --production to simulate production but then building the desktop app does not work because it cannot find the files.
So this is a bit of an oversight. Basically we are building a production app, although we are grabbing the development code bundle. Meteor.isDevelopment should not be true for built desktop apps.
Although if you let hot code refresh do its thing, as soon as the desktop app connects to the production server it grabs the production code and updates itself. So it works but only after hot code reload.
Nice find, this is definitely an issue that should be resolved.
We could modify the bundle, but that feels weird...
Running with production, even though it's terribly slow, seems like the way to go.
should probably run the server with --production to simulate production but then building the desktop app does not work because it cannot find the files.
What do you mean that it cannot find the files?
The correct way to build a production app is just to run npm run desktop -- build-installer -b
- no need to run meteor alongside.
@wojtkowiak I just tried building with the -b option so you do not need to run meteor separately and it fails with the following error:
VERBOSE meteorApp: copying mobile build
INFO meteorApp: injecting isDesktop
INFO meteorApp: injected successfully
ERROR meteorApp: could not find runtime config in index file
npm ERR! code ELIFECYCLE
I have no idea why, any pointers that would help me temporarily get it working? Thanks
@wojtkowiak Actually the issue above with using -b was the fault of my code. I fixed it and now it works using -b. But without -b you have to start meteor process and have it running. If you start it with --production then it fails. But without --production Meteor.isDevelopment is still true