-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
29 lines (22 loc) · 1.02 KB
/
script.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
28
29
(function(doc){
var scriptElm = doc.scripts[doc.scripts.length - 1];
var warn = ['[ionicons] Deprecated script, please remove: ' + scriptElm.outerHTML];
warn.push('To improve performance it is recommended to set the differential scripts in the head as follows:')
var parts = scriptElm.src.split('/');
parts.pop();
parts.push('ionicons');
var url = parts.join('/');
var scriptElm = doc.createElement('script');
scriptElm.setAttribute('type', 'module');
scriptElm.src = url + '/ionicons.esm.js';
warn.push(scriptElm.outerHTML);
scriptElm.setAttribute('data-stencil-namespace', 'ionicons');
doc.head.appendChild(scriptElm);
scriptElm = doc.createElement('script');
scriptElm.setAttribute('nomodule', '');
scriptElm.src = url + '/ionicons.js';
warn.push(scriptElm.outerHTML);
scriptElm.setAttribute('data-stencil-namespace', 'ionicons');
doc.head.appendChild(scriptElm)
console.warn(warn.join('\n'));
})(document);