1 |
|
2 | (function(doc){
|
3 | var scriptElm = doc.scripts[doc.scripts.length - 1];
|
4 | var warn = ['[ionic] Deprecated script, please remove: ' + scriptElm.outerHTML];
|
5 |
|
6 | warn.push('To improve performance it is recommended to set the differential scripts in the head as follows:')
|
7 |
|
8 | var parts = scriptElm.src.split('/');
|
9 | parts.pop();
|
10 | parts.push('ionic');
|
11 | var url = parts.join('/');
|
12 |
|
13 | var scriptElm = doc.createElement('script');
|
14 | scriptElm.setAttribute('type', 'module');
|
15 | scriptElm.src = url + '/ionic.esm.js';
|
16 | warn.push(scriptElm.outerHTML);
|
17 | scriptElm.setAttribute('data-stencil-namespace', 'ionic');
|
18 | doc.head.appendChild(scriptElm);
|
19 |
|
20 |
|
21 | scriptElm = doc.createElement('script');
|
22 | scriptElm.setAttribute('nomodule', '');
|
23 | scriptElm.src = url + '/ionic.js';
|
24 | warn.push(scriptElm.outerHTML);
|
25 | scriptElm.setAttribute('data-stencil-namespace', 'ionic');
|
26 | doc.head.appendChild(scriptElm)
|
27 |
|
28 | console.warn(warn.join('\n'));
|
29 |
|
30 | })(document); |
\ | No newline at end of file |