No Description

App.cpp 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "pch.h"
  2. #include "App.h"
  3. #include "ReactPackageProvider.h"
  4. #include "winrt/ReactNativeWebView.h"
  5. using namespace winrt::WebViewWindows;
  6. using namespace winrt::WebViewWindows::implementation;
  7. /// <summary>
  8. /// Initializes the singleton application object. This is the first line of
  9. /// authored code executed, and as such is the logical equivalent of main() or
  10. /// WinMain().
  11. /// </summary>
  12. App::App() noexcept
  13. {
  14. MainComponentName(L"example");
  15. #if BUNDLE
  16. JavaScriptBundleFile(L"index.windows");
  17. InstanceSettings().UseWebDebugger(false);
  18. InstanceSettings().UseLiveReload(false);
  19. #else
  20. JavaScriptMainModuleName(L"example/index");
  21. InstanceSettings().UseWebDebugger(true);
  22. InstanceSettings().UseLiveReload(true);
  23. #endif
  24. #if _DEBUG
  25. InstanceSettings().EnableDeveloperMenu(true);
  26. #else
  27. InstanceSettings().EnableDeveloperMenu(false);
  28. #endif
  29. PackageProviders().Append(make<ReactPackageProvider>()); // Includes all modules in this project
  30. PackageProviders().Append(winrt::ReactNativeWebView::ReactPackageProvider());
  31. InitializeComponent();
  32. }