File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @sveltejs/adapter-static ' : patch
3+ ---
4+
5+ fix: correctly list dynamic routes in error log
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ export default function (options) {
88
99 async adapt ( builder ) {
1010 if ( ! options ?. fallback ) {
11- if ( builder . routes . some ( ( route ) => route . prerender !== true ) && options ?. strict !== false ) {
11+ const dynamic_routes = builder . routes . filter ( ( route ) => route . prerender !== true ) ;
12+ if ( dynamic_routes . length > 0 && options ?. strict !== false ) {
1213 const prefix = path . relative ( '.' , builder . config . kit . files . routes ) ;
1314 const has_param_routes = builder . routes . some ( ( route ) => route . id . includes ( '[' ) ) ;
1415 const config_option =
@@ -22,7 +23,7 @@ export default function (options) {
2223
2324 builder . log . error (
2425 `@sveltejs/adapter-static: all routes must be fully prerenderable, but found the following routes that are dynamic:
25- ${ builder . routes . map ( ( route ) => ` - ${ path . posix . join ( prefix , route . id ) } ` ) . join ( '\n' ) }
26+ ${ dynamic_routes . map ( ( route ) => ` - ${ path . posix . join ( prefix , route . id ) } ` ) . join ( '\n' ) }
2627
2728You have the following options:
2829 - set the \`fallback\` option — see https://kit.svelte.dev/docs/single-page-apps#usage for more info.
You can’t perform that action at this time.
0 commit comments