This repository was archived by the owner on Jan 11, 2023. It is now read-only.
sapper export --no-subfolders #1021
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem
I want
src/routes/foo.svelte
to match/foo
in the url.Current situation
src/routes/foo.svelte
exports tofoo/index.html
Certain static hosting providers (github-pages in my case) will see the generated foo folder and will redirect to
/foo/
(with a trailing slash) before displaying the contents of the index.html.This PR
This PR add a
--no-subfolders
option tosapper export
The option wil generate
/export/foo.html
fromsrc/routes/foo.svelte
Github pages and others will match the
/foo
url to thefoo.html
file without redirect.The feature behaves similar to the subFolders option in nuxt
The patch itself is very small, couple of lines in cli.ts and export.ts
But i've also included tests (based on the regular export test) and added a line to the documentation.