Skip to content
Discussion options

You must be logged in to vote

Use SvelteKit's asset placeholder instead of a route-relative literal:

<script src="%sveltekit.assets%/config.js"></script>

Keep config.js in static/. During generation, %sveltekit.assets% becomes paths.assets when configured, otherwise the correct relative path to paths.base, so nested pages do not resolve it from their own directory. This is the documented app.html placeholder: https://svelte.dev/docs/kit/project-structure#Project-files-src-app.html

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gitsang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants