-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Description
SvelteKit has a trailingSlash option which indicates whether we expect URLs to have a trailing slash or not. By default all URLs do not have a trailing slash. However, Vite forces a trailing slash on the base URL.
Implementing this would close #8770 and #8772
Suggested solution
Vite could accept base with or without a trailing slash so that the user can decide which they would prefer. However, this would be a breaking change as anything reading base from the config would now have to handle the possibility both of it having or not having a trailing slash
Alternative
Add a new trailingSlash option similar to SvelteKit's. I think it would likely only affect the base URL though for Vite
#8772 is open which affects this functionality as well, but would not work as a solution for SvelteKit as it always forces a trailing slash and would conflict with SvelteKit's trailingSlash option
Additional context
SvelteKit historically hasn't used the publicDir and base options, but does its own static asset serving. I put together a branch to use Vite's implementation, but some of our tests are failing with it due to this issue, which is a blocker for us.
https://github.com/sveltejs/kit/pull/5601/files#r923967104
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status