`adapter-static` configuration item `assets` does not affect `%sveltekit.assets%`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the bug
When setting adapter-static configuration item assets to a custom location (e.g. the folder build/assets. The path %sveltekit.assets% and paths to other resources are not affected and they still point to /_app instead of assets/_app.
Reproduction
- Open: https://stackblitz.com/edit/sveltejs-kit-template-default-yqrfta?file=build%2Findex.html
- Run:
npm i -D @sveltejs/adapter-static - Run:
npm run build - Check out file paths at
build/index.html
Logs
Logs are not relevant.
System Info
System info is not relevant.
Severity
annoyance
Additional Information
This is required in order to cleanly separate projects by namespacing URLs (e.g. /assets for Svelte and /api for REST). Then you can tell the web server to redirect /api to the backend and serve /assets to clients while still being able to serve index.html for domain /. There are many workarounds obviously, but no "clean" solutions (at least my opinion).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the StackBlitz reproduction and inspect build/index.html after installing @sveltejs/adapter-static and running npm run build. Trace how the adapter-static assets option is applied to generated paths, and confirm done when %sveltekit.assets% and other resource paths use the configured assets location instead of /_app.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100