2019-09-19 15:35:40 +12:00
|
|
|
import { createApp } from "./createApp";
|
2019-09-07 00:04:23 +12:00
|
|
|
|
2019-09-07 17:50:35 +12:00
|
|
|
const appDefinition = window["##BUDIBASE_APPDEFINITION##"];
|
|
|
|
|
2019-09-19 15:35:40 +12:00
|
|
|
const componentLibraryUrl = (lib) => "./" + trimSlash(lib)
|
|
|
|
|
|
|
|
const trimSlash = (str) => str.replace(/^\/+|\/+$/g, '');
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
|
|
|
|
const componentLibraries = {};
|
|
|
|
|
|
|
|
for(let lib of appDefinition.componentLibraries) {
|
|
|
|
componentLibraries[lib.libName] = await import(
|
|
|
|
componentLibraryUrl(lib.importPath));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const _app = createApp(componentLibraries);
|
|
|
|
|
|
|
|
_app.initialiseComponent(
|
|
|
|
props,
|
|
|
|
document.body);
|
|
|
|
|
|
|
|
})();
|