HTMLスクリプト読み込み戦略ビルダーとは
HTMLスクリプト読み込み戦略ビルダーは、normal、defer、async、type moduleの適切な読み込み戦略でscriptタグを生成します。 出力は公開サイトに使う前に確認しやすい形で表示されます。
Quick answer
Choose a script loading strategy based on when the script must execute. Use defer for scripts that need the full DOM but can download in parallel. Use async for independent scripts like analytics. Use type='module' for modern ES module code.
Limitations
- defer preserves script execution order; async does not. Choose based on whether script order matters.
- async scripts execute as soon as they finish downloading, which can block rendering if the script is large.
- type='module' scripts are deferred by default and do not need an additional defer attribute.
使い方
- 必要な値を入力します。
- 結果パネルの出力を確認します。
- ページに合う部分だけコピーします。
- 公開前にブラウザとホスティング環境で確認します。
主な用途
- 公開前の繰り返し作業を短くする。
- マークアップ、CSS、チェックリストを準備する。
- 静的サイトで見落としやすい小さなミスを減らす。