Someone on the general chat recommended using this for detecting local environment debugging only. But it appears to not be available when the app is published to Expo.
I would think a manifest should never delete properties it isn’t using, it should redefine them as false.
Hi @ericjames - I’m not quite sure I understand what the issue is here. If packagerOpts.dev is undefined then that means the app is running in prod/published mode. Could you explain what you were expecting to see and what you’re trying to achieve?
What I was actually doing was not wanting to send Google Analytics events if I was running in local environment mode. So I was looking for a constant variable that Expo could tell me if we were in DEV vs the actual app (like PROD).
That behavior is fine, would I simply look for the existence of packagerOpts?
A side note, the docs are often not informative enough or at least not clear what everything is/doing. Maybe the authors should provide a link to the original issue or discussion in Github.
@ericjames the packagerOpts key will exist if your app is being served locally from a packager server (rather than using pre-bundled JS). You could do something like let isDev = packagerOpts && packagerOpts.dev which should handle all cases and tell you what you want.
Our docs are always a work in progress – if there are any specific changes or improvements you would like to see you are welcome to send us a PR!