How to load javascript/css files only for a particular route, say /form?
I can add them in app.html under <head> and will work, but that will cause these javascript loads for all routes unnecessarily.
I tried to put them using svelt:head under svelte file of the corresponding route as follows:
<svelte:head>
<link rel="stylesheet" href="external.css" />
<script src="external.js"></script>
</svelte:head>
This will load make the js/css file to load as expected only if we directly load/refresh the route like localhost:3000/form. But will not work if I navigate from home page to /form route. Seems Sveltekit doesn't re-render the <head> when we naviagate.
Any idea how to do that?