이 튜토리얼에서 Apache Cordova를 사용하여 호스팅 된 웹 응용 프로그램을 개발하는 데 Visual Studio 2015를 사용하고 있습니다. http://taco.visualstudio.com/en-us/docs/create-a-hosted-app Cordova WebView의 특정 응용 프로그램 URL에 대해이 URL을 여러 개 설정해야합니다 장소 (config.xml, index.html, index.js). 이 URL은 개발 및 프로덕션 환경에 따라 다릅니다. 그리고 프로덕션 용 응용 프로그램을 빌드하기 전에 여러 위치 (config.xml, index.html, index.js)에서 URL을 대체해야합니다. 이 작업을 자동화 할 수 있습니까 (깡패와 타코 팀 빌드 모듈을 통해)?빌드하기 전에 호스트 응용 프로그램 URL 변경 Visual Studio에서 Cordova 응용 프로그램 2015
-1
A
답변
0
결국 내 결정은 매우 간단합니다.
나는 config.xml에
<allow-navigation href="http://dev/*" />
<allow-navigation href="http://prod/*" />
index.html을
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: http://dev/ http://prod/ https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
그리고 하는 index.js에서 I config.xml
과
index.html
에 개발 및 생산 URL을 모두 추가 필요한 URL을 반환하는 함수를 생성하십시오.
function getConnectionInfo(production: boolean): ConnectionInfo
{
if (production)
{
return {
TargetUrl: 'http://prod/',
UsePassword: false,
User: '',
Password: ''
};
}
return {
TargetUrl: 'http://dev/',
UsePassword: false,
User: '',
Password: ''
};
}
내가 생산 응용 프로그램을 빌드하는 경우 나는 getConnectionInfo(true);
관련 문제
- 1. Visual Studio로 Citrix 응용 프로그램 UITesting 2015
- 2. 호스트 웹 응용 프로그램
- 3. Visual Studio Cordova 응용 프로그램 ID
- 4. 응용 프로그램 호스트
- 5. Visual Studio에서 Azure 응용 프로그램 디버깅
- 6. Visual Studio에서 응용 프로그램 경로 설정
- 7. Visual Studio에서 Office 2013 응용 프로그램 만들기
- 8. Visual Studio에서 Angular2 응용 프로그램 디버깅 코드
- 9. 응용 프로그램 저장소 응용 프로그램 이름 변경
- 10. Cordova + WinJS 응용 프로그램 현지화
- 11. Windows의 Visual Studio에서 다중 사이트 웹 응용 프로그램 디버깅 8.1
- 12. 이름 변경 응용 프로그램
- 13. 호스트 웹 사이트 내 MVC 응용 프로그램
- 14. iPhone 응용 프로그램 지원 폴더 포함 파일을 빌드하기 전에
- 15. 안전 URL/응용 프로그램
- 16. 응용 프로그램 - 상대 URL
- 17. PHP 응용 프로그램 URL
- 18. Glassfish 응용 프로그램 URL
- 19. Python 응용 프로그램 URL
- 20. Visual C++ 응용 프로그램 글꼴 변경
- 21. AppHarbour의 호스트 MVC 응용 프로그램
- 22. 콘솔 응용 프로그램에서 mvc 응용 프로그램 호스트
- 23. Winforms 응용 프로그램에서 Silverlight 응용 프로그램 호스트
- 24. 동일한 코드베이스에서 2 개의 응용 프로그램 빌드하기
- 25. 응용 프로그램 용 응용 프로그램
- 26. 변경 Properties.settings 응용 프로그램
- 27. 응용 프로그램 아이콘 변경
- 28. 응용 프로그램 이름 변경
- 29. Java 변경 응용 프로그램
- 30. 응용 프로그램 이름 변경