Skip to content

Commit

Permalink
add leading / to isr routes (#9100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris authored Feb 17, 2023
1 parent 3345b71 commit ce52f9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-points-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-vercel': patch
---

fix: add leading / to isr routes
4 changes: 2 additions & 2 deletions packages/adapter-vercel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,12 @@ const plugin = function (defaults = {}) {

static_config.routes.push({
src: src + '$',
dest: `${isr_name}${q}`
dest: `/${isr_name}${q}`
});

static_config.routes.push({
src: src + '/__data.json$',
dest: `${isr_name}/__data.json${q}`
dest: `/${isr_name}/__data.json${q}`
});
} else if (!singular) {
static_config.routes.push({ src: src + '(?:/__data.json)?$', dest: `/${name}` });
Expand Down

0 comments on commit ce52f9e

Please sign in to comment.