File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1717icons /
1818.DS_Store
1919scripts /* .js
20+ ! scripts /install-loader.js
2021
2122www /
Original file line number Diff line number Diff line change 1+
2+ ( function ( doc ) {
3+ var scriptElm = doc . scripts [ doc . scripts . length - 1 ] ;
4+ var warn = [ '[ionicons] 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 ( 'ionicons' ) ;
11+ var url = parts . join ( '/' ) ;
12+
13+ var scriptElm = doc . createElement ( 'script' ) ;
14+ scriptElm . setAttribute ( 'type' , 'module' ) ;
15+ scriptElm . src = url + '/ionicons.esm.js' ;
16+ warn . push ( scriptElm . outerHTML ) ;
17+ scriptElm . setAttribute ( 'data-stencil-namespace' , 'ionicons' ) ;
18+ doc . head . appendChild ( scriptElm ) ;
19+
20+
21+ scriptElm = doc . createElement ( 'script' ) ;
22+ scriptElm . setAttribute ( 'nomodule' , '' ) ;
23+ scriptElm . src = url + '/ionicons.js' ;
24+ warn . push ( scriptElm . outerHTML ) ;
25+ scriptElm . setAttribute ( 'data-stencil-namespace' , 'ionicons' ) ;
26+ doc . head . appendChild ( scriptElm )
27+
28+ console . warn ( warn . join ( '\n' ) ) ;
29+
30+ } ) ( document ) ;
You can’t perform that action at this time.
0 commit comments