#include "pch.h"
#include "App.h"
#include "ReactPackageProvider.h"
#include "winrt/ReactNativeWebView.h"
using namespace winrt::WebViewWindows;
using namespace winrt::WebViewWindows::implementation;
///
/// Initializes the singleton application object. This is the first line of
/// authored code executed, and as such is the logical equivalent of main() or
/// WinMain().
///
App::App() noexcept
{
MainComponentName(L"example");
#if BUNDLE
JavaScriptBundleFile(L"index.windows");
InstanceSettings().UseWebDebugger(false);
InstanceSettings().UseLiveReload(false);
#else
JavaScriptMainModuleName(L"example/index");
InstanceSettings().UseWebDebugger(true);
InstanceSettings().UseLiveReload(true);
#endif
#if _DEBUG
InstanceSettings().EnableDeveloperMenu(true);
#else
InstanceSettings().EnableDeveloperMenu(false);
#endif
PackageProviders().Append(make()); // Includes all modules in this project
PackageProviders().Append(winrt::ReactNativeWebView::ReactPackageProvider());
InitializeComponent();
// This works around a cpp/winrt bug with composable/aggregable types tracked
// by 22116519
AddRef();
m_inner.as<::IUnknown>()->Release();
}