Skip to content

Commit

Permalink
Add leading slash to Pages deployment manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
GregBrimble committed May 4, 2022
1 parent bae5ba4 commit 2d34fcb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-experts-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

fix: Adds the leading slash to Pages deployment manifests that the API expects, and fixes manifest generation on Windows machines.
2 changes: 1 addition & 1 deletion packages/wrangler/src/__tests__/pages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ describe("pages", () => {
const manifest = JSON.parse(body.get("manifest") as string);
expect(manifest).toMatchInlineSnapshot(`
Object {
"logo.png": "2082190357cfd3617ccfe04f340c6247",
"/logo.png": "2082190357cfd3617ccfe04f340c6247",
}
`);

Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/pages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ const createDeployment: CommandModule<
} else {
let name;
if (depth) {
name = join(...filepath.split(sep).slice(1));
name = filepath.split(sep).slice(1).join("/");
} else {
name = file;
}
Expand Down Expand Up @@ -1146,7 +1146,7 @@ const createDeployment: CommandModule<
JSON.stringify(
Object.fromEntries(
[...fileMap.entries()].map(([fileName, file]) => [
fileName,
`/${fileName}`,
file.metadata.hash,
])
)
Expand Down

0 comments on commit 2d34fcb

Please sign in to comment.