Skip to content

Commit

Permalink
docs: use href attribute for link with rel=modulepreload (#1386)
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-es authored Apr 2, 2024
1 parent 442bdce commit 7337643
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions guide/backend-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<script type="module" src="/{{ manifest[name].file }}"></script>
<!-- for chunk of importedChunks(manifest, name) -->
<link rel="modulepreload" src="/{{ chunk.file }}" />
<link rel="modulepreload" href="/{{ chunk.file }}" />
```

具体的には、マニフェストファイルとエントリーポイントが指定された場合、HTML を生成するバックエンドは以下のタグを含める必要があります。
Expand All @@ -129,7 +129,7 @@
<link rel="stylesheet" href="assets/shared.a834bfc3.css" />
<script type="module" src="assets/main.4889e940.js"></script>
<!-- オプション -->
<link rel="modulepreload" src="assets/shared.83069a53.js" />
<link rel="modulepreload" href="assets/shared.83069a53.js" />
```

一方、エントリーポイント `views/foo.js` に対しては、以下が含まれるはずです。
Expand All @@ -138,5 +138,5 @@
<link rel="stylesheet" href="assets/shared.a834bfc3.css" />
<script type="module" src="assets/foo.869aea0d.js"></script>
<!-- オプション -->
<link rel="modulepreload" src="assets/shared.83069a53.js" />
<link rel="modulepreload" href="assets/shared.83069a53.js" />
```

0 comments on commit 7337643

Please sign in to comment.