File tree Expand file tree Collapse file tree 4 files changed +5
-3
lines changed Expand file tree Collapse file tree 4 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ function buildNode(
198198 continue ;
199199 } else if (
200200 tagName === 'link' &&
201- n . attributes . rel === 'preload' &&
201+ ( n . attributes . rel === 'preload' || n . attributes . rel === 'modulepreload' ) &&
202202 n . attributes . as === 'script'
203203 ) {
204204 // ignore
Original file line number Diff line number Diff line change @@ -789,9 +789,9 @@ function slimDOMExcluded(
789789 slimDOMOptions . script &&
790790 // script tag
791791 ( sn . tagName === 'script' ||
792- // preload link
792+ // (module) preload link
793793 ( sn . tagName === 'link' &&
794- sn . attributes . rel === 'preload' &&
794+ ( sn . attributes . rel === 'preload' || sn . attributes . rel === 'modulepreload' ) &&
795795 sn . attributes . as === 'script' ) ||
796796 // prefetch link
797797 ( sn . tagName === 'link' &&
Original file line number Diff line number Diff line change @@ -337,6 +337,7 @@ exports[`integration tests [html file]: preload.html 1`] = `
337337 <title >Document</title >
338338 <link />
339339 <link />
340+ <link />
340341 </head >
341342 <body ></body ></html >"
342343` ;
Original file line number Diff line number Diff line change 44 < meta charset ="UTF-8 " />
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
66 < title > Document</ title >
7+ < link rel ="modulepreload " href ="https://example/path/to/preload.js " as ="script " />
78 < link rel ="preload " href ="https://example/path/to/preload.js " as ="script " />
89 < link rel ="prefetch " href ="https://example/path/to/prefetch.js " />
910 </ head >
You can’t perform that action at this time.
0 commit comments