-
Notifications
You must be signed in to change notification settings - Fork 0
/
esm.mjs
23 lines (21 loc) · 797 Bytes
/
esm.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import dynamicImport from './dynamicImport.mjs';
(async global => {
const {DynamicModules = (global.DynamicModules = {})} = global;
if (!DynamicModules.ready) {
const {mode} = DynamicModules;
try {
DynamicModules.mode = 'ESM';
typeof requestAnimationFrame !== 'function' || (await new Promise(requestAnimationFrame));
await (await dynamicImport('./bootstrap.js')).default;
await DynamicModules.ready;
} catch (exception) {
exception.stack;
DynamicModules.mode = mode;
throw exception;
}
} else {
console.warn(`Skipped reinitializing dynamic modules (initialized mode = ${DynamicModules.mode || 'unknown'})`);
await DynamicModules.ready;
}
await dynamicImport('./modules.spec.js');
})((typeof globalThis === 'object' && globalThis) || (1, eval)('this'));