diff --git a/.changeset/small-apples-visit.md b/.changeset/small-apples-visit.md new file mode 100644 index 000000000000..e811fa0f1bc0 --- /dev/null +++ b/.changeset/small-apples-visit.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +Always create `$types` for a route with a layout, leaf or endpoint diff --git a/packages/kit/src/core/sync/write_types.js b/packages/kit/src/core/sync/write_types.js index 470bd418e16f..ab1204d3a7fa 100644 --- a/packages/kit/src/core/sync/write_types.js +++ b/packages/kit/src/core/sync/write_types.js @@ -112,7 +112,7 @@ function update_types(config, manifest_data, route) { input_files.push(route.endpoint.file); } - if (input_files.length === 0) return; // nothing to do + if (!route.leaf && !route.layout && !route.endpoint) return; // nothing to do try { fs.mkdirSync(outdir, { recursive: true });