Skip to content

Commit

Permalink
[feat] more specific types for kit.prerender.entries config (#4880)
Browse files Browse the repository at this point in the history
* fix: fix: more relyable typings of config.kit.prerender.entries

* Create changeset file

* Update .changeset/long-turkeys-boil.md

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
  • Loading branch information
HarryAllen1 and benmccann committed May 12, 2022
1 parent e8794cb commit e4892d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/long-turkeys-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sveltejs/kit": patch
---

[feat] more specific types for `kit.prerender.entries` config
1 change: 1 addition & 0 deletions packages/kit/src/core/config/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ test('fails if prerender.entries are invalid', () => {
validate_config({
kit: {
prerender: {
// @ts-expect-error - given value expected to throw
entries: ['foo']
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export interface Config {
crawl?: boolean;
default?: boolean;
enabled?: boolean;
entries?: string[];
entries?: Array<'*' | `/${string}`>;
onError?: PrerenderOnErrorValue;
};
routes?: (filepath: string) => boolean;
Expand Down

0 comments on commit e4892d4

Please sign in to comment.