1 |
|
2 | exports.applyPolyfills = function() { return Promise.resolve() };
|
3 |
|
4 | exports.defineCustomElements = function(_, opts) {
|
5 | return new Promise(function(resolve, reject) {
|
6 | if (typeof document !== 'undefined') {
|
7 | opts = opts || {};
|
8 | var mod = document.createElement('script');
|
9 | mod.setAttribute('type', 'module');
|
10 | mod['data-opts'] = opts;
|
11 | mod.src = 'https://cdn.jsdelivr.net/npm/@ionic/core@5.2.2/dist/ionic/ionic.esm.js';
|
12 |
|
13 | var legacy = document.createElement('script');
|
14 | legacy.setAttribute('nomodule', '');
|
15 | legacy['data-opts'] = opts;
|
16 | legacy.src = 'https://cdn.jsdelivr.net/npm/@ionic/core@5.2.2/dist/ionic/ionic.js';
|
17 |
|
18 | mod.onload = resolve;
|
19 | mod.onerror = reject;
|
20 |
|
21 | legacy.onload = resolve;
|
22 | legacy.onerror = reject;
|
23 |
|
24 | document.head.appendChild(mod);
|
25 | document.head.appendChild(legacy);
|
26 | } else {
|
27 | resolve();
|
28 | }
|
29 | });
|
30 | }
|