@sveltejs/kit 1.0.0-next.416 → 1.0.0-next.417
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -172,12 +172,22 @@ export default function create_manifest_data({
|
|
|
172
172
|
if (item.is_page) {
|
|
173
173
|
const route = /** @type {import('types').PageData} */ (route_map.get(id));
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
// This ensures that layouts and errors are set for pages that have no Svelte file
|
|
176
|
+
// and only redirect or throw an error, but are set to the Svelte file definition if it exists.
|
|
177
|
+
// This ensures the proper error page is used and rendered in the proper layout.
|
|
178
|
+
if (item.kind === 'component' || route.layouts.length === 0) {
|
|
179
|
+
const { layouts, errors } = trace(
|
|
180
|
+
tree,
|
|
181
|
+
id,
|
|
182
|
+
item.kind === 'component' ? item.uses_layout : undefined,
|
|
183
|
+
project_relative
|
|
184
|
+
);
|
|
179
185
|
route.layouts = layouts;
|
|
180
186
|
route.errors = errors;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (item.kind === 'component') {
|
|
190
|
+
route.leaf.component = project_relative;
|
|
181
191
|
} else if (item.kind === 'server') {
|
|
182
192
|
route.leaf.server = project_relative;
|
|
183
193
|
} else {
|