This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
Add support for custom route file extensions. #632
Merged
+346
−16
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.
Adds an
--ext
option to the sapper cli to allow users to define custom file extensions for route components.I don't know if this is how you would like to achieve this, the Sapper codebase is pretty alien to me, but this seems to work. It still defaults to the old
.svelte
and.html
extensions when no argument is passed.I added a new folder
test/app/custom-extensions
with some tests because I needed a custom config to check that arbitrary file extensions worked. I also added some unit tests (or tried) but they all seem to be broken (and switched off) and I don't know enough about what the manifest is supposed to look like to be confident of fixing them. But there is something resembling a unit test for custom extensions in there too.I've also tested this locally with a sapper-template and it doesn't seem to break any of the builds, with or without an amusing extension (I don't really know how to test dev/export with the AppRunner thing).
I think this would close #219. Not sure if there are any other issues relating to this.