Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: use href attribute for link with rel=modulepreload #1386

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" />
```
Loading