22 lines
624 B
JavaScript
22 lines
624 B
JavaScript
|
window.modules.register("$app", () => {
|
||
|
const App = window.modules.require("App");
|
||
|
|
||
|
if (!window._APP_ENV)
|
||
|
throw new Error("$app: could not find window._APP_ENV");
|
||
|
if (!App)
|
||
|
throw new Error("$app: require('App') returned undefined");
|
||
|
|
||
|
const initialLoading = document.getElementById("initial-loading");
|
||
|
if (initialLoading) {
|
||
|
initialLoading.parentElement.removeChild(initialLoading);
|
||
|
}
|
||
|
|
||
|
const appMountElement = document.createElement("div");
|
||
|
document.body.appendChild(appMountElement);
|
||
|
|
||
|
const app = new App(appMountElement);
|
||
|
app.mount();
|
||
|
|
||
|
return app;
|
||
|
});
|