-
Notifications
You must be signed in to change notification settings - Fork 63
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
In prod script: process.env.NODE_ENV === "production" returns false #17
Comments
After investigating into this, I found the problem, it comes from loadEnv in vue cli Service... This method checks if there are .env files like As loadEnv is first called with i.e. 'cordova-build-android', it is set to So one solution would be, to create Another solution, would be maybe, that I unset process.env.NODE_ENV before I run build, however this would unset any setting from the .env.cordova-build-android file. I would need to test this more, I think, if the .env.cordova-build-platform doesn't exist, there's no problem to unset it, or if it exists, I need to check, if NODE_ENV is set, in this file... However I personally don't like this second solution much, because it's more a work around the problem from loadEnv... |
PS: For my commands I need to have different modes, otherwise the part with process.env.CORDOVA_PLATFORM, and the JSMiddleware are not working... |
I created a feature request for the cli, because I think, this is the best solution IMO. In the meantime, you can add the specific .env.cordova-build-platform files... |
Great!! Thanks a lot! |
FWI it also allows you to build using different mode |
No description provided.
The text was updated successfully, but these errors were encountered: