forked from nuxeo/nuxeo-web-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
27 lines (23 loc) · 818 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { importHref } from '@nuxeo/nuxeo-ui-elements/import-href.js';
// load app
import './elements/nuxeo-app.js';
// load Web UI bundle
import html from './elements/nuxeo-web-ui-bundle.html';
const tmpl = document.createElement('template');
tmpl.innerHTML = html;
document.head.appendChild(tmpl.content);
// load addons / bundles
// NXP-26977: await loading of addons
Promise.all(
Nuxeo.UI.bundles.map((url) => {
if (url.endsWith('.html')) {
return new Promise((resolve, reject) => importHref(url, resolve, reject));
}
return import(
/* webpackChunkName: "[request]" */
/* webpackInclude: /addons\/[^\/]+\/[^\/]+\.js$/ */
// eslint-disable-next-line comma-dangle
`./addons/${url}`
);
}),
).then(() => import(/* webpackMode: "eager" */ './elements/routing.js'));