Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add leading slashes to Pages manifest #892

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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