Skip to content

Commit a09db8c

Browse files
fix: make <build> route exclusion rule only exclude static assets (#13411)
* make `<build>` route exclusion rule only exclude static assets * Update .changeset/chilled-timers-give.md --------- Co-authored-by: Tee Ming <[email protected]>
1 parent 461aa95 commit a09db8c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/chilled-timers-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-cloudflare': patch
3+
---
4+
5+
fix: exclude the dynamic route `/_app/env.js` from the adapter config `routes.exclude` special value `<build>`

packages/adapter-cloudflare/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function get_routes_json(builder, assets, { include = ['/*'], exclude = ['<all>'
127127
.flatMap((rule) => (rule === '<all>' ? ['<build>', '<files>', '<prerendered>'] : rule))
128128
.flatMap((rule) => {
129129
if (rule === '<build>') {
130-
return `/${builder.getAppPath()}/*`;
130+
return [`/${builder.getAppPath()}/immutable/*`, `/${builder.getAppPath()}/version.json`];
131131
}
132132

133133
if (rule === '<files>') {

0 commit comments

Comments
 (0)