May 13, 2023
1
Level 10
Inertia Module Preloads
I'm looking at a fresh install of Laravel Jetstream with Inertia and trying to understand how pages are loaded. The inspector shows three references to the Welcome page module:
<link rel="modulepreload" href="http://testing.localhost/build/assets/Welcome-f0af674f.js">
...
<script type="module" src="http://testing.localhost/build/assets/Welcome-f0af674f.js"></script>
...
<link rel="modulepreload" as="script" crossorigin="" href="/build/assets/Welcome-f0af674f.js">
The first line preloads the script and the second loads and runs it. Both lines are generated by @vite(['resources/js/app.js', "resources/js/Pages/{$page['component']}.vue"]).
What does the third line, generated by @inertiaHead, do that isn't already being accomplished?
Please or to participate in this conversation.