Best practices to manage Debug and Release versions of an application using Nativescript?

心已入冬 提交于 2020-01-07 06:49:12

问题


I am developing a Nativescript application which makes numerous server calls for various services. The test and production URLs for these calls are different and while switching back and forth between the Debug and Release version I might miss or mess something up (by accidentally using a production URL for debug app). I wanted to know if there are any best practices regarding this aspect of App publishing? I couldn't find any specific answer regarding my question on the internet and the closest thing I found were these article for ReactNative apps:

http://www.multunus.com/blog/2016/06/automated-environment-management-react-native-ios/

http://blog.carbonfive.com/2016/09/29/setting-up-react-native-build-environments-using-nativemodules/

If someone can guide me on this specific to Nativescript application, I would really appreciate it. Thanks.


回答1:


You can try use this https://www.npmjs.com/package/nativescript-hook-debug-production when you are trying to debug build it will do filename.debug.extension or when production then from filename.production.extension to filename.extension so inside code, you can require or link to filename.extension



来源:https://stackoverflow.com/questions/41514418/best-practices-to-manage-debug-and-release-versions-of-an-application-using-nati

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!