UNPKG

818 BJavaScriptView Raw
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 doc.head.appendChild(scriptElm);
17 warn.push(scriptElm.outerHTML);
18
19 scriptElm = doc.createElement('script');
20 scriptElm.setAttribute('nomodule', '');
21 scriptElm.src = url + '/ionic.js';
22 doc.head.appendChild(scriptElm);
23 warn.push(scriptElm.outerHTML);
24
25 console.warn(warn.join('\n'));
26
27})(document);
\No newline at end of file