Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefix all route IDs with / #7338

Merged
merged 2 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/strange-crabs-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

[breaking] Prefix all route IDs with /
2 changes: 1 addition & 1 deletion packages/kit/src/core/prerender/prerender.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ export async function prerender() {
for (const [id, prerender] of prerender_map) {
if (prerender) {
if (id.includes('[')) continue;
const path = `/${id.split('/').filter(affects_path).join('/')}`;
const path = `${id.split('/').filter(affects_path).join('/')}`;
enqueue(null, config.paths.base + path);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/core/sync/create_manifest_data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function create_routes_and_nodes(cwd, config, fallback) {
}
};

walk(0, '', '', null);
walk(0, '/', '', null);

if (routes.length === 1) {
const root = routes[0];
Expand All @@ -223,7 +223,7 @@ function create_routes_and_nodes(cwd, config, fallback) {
// If there's no routes directory, we'll just create a single empty route. This ensures the root layout and
// error components are included in the manifest, which is needed for subsequent build/dev commands to work
routes.push({
id: '',
id: '/',
segment: '',
pattern: /^$/,
names: [],
Expand Down
Loading