Skip to content

Commit

Permalink
preload css
Browse files Browse the repository at this point in the history
  • Loading branch information
0xb4lint committed May 12, 2021
1 parent 00e1848 commit 2cbf832
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-webfont-dl",
"version": "1.0.4",
"version": "1.0.5",
"description": "",
"main": "dist/vite-plugin-webfont-dl.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/css-injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export class CssInjector {
public inject(html: string, base: string, path: string): string {
return html.replace(
'</head>',
`<link rel="stylesheet" media="print" onload="this.onload=null;this.removeAttribute('media');" href="${base}${path}">\n</head>`
`<link rel="preload" as="style" href="${base}${path}">\n<link rel="stylesheet" media="print" onload="this.onload=null;this.removeAttribute('media');" href="${base}${path}">\n</head>`
);
}
}
Expand Down

0 comments on commit 2cbf832

Please sign in to comment.