Skip to content

Commit

Permalink
fix: the pathing for the template was resolving using __dirname int…
Browse files Browse the repository at this point in the history
…o the esbuild file which then used a relative path back from pages. When ran inside a test would get a resolved absolute path to the template from "pages/pages/functions/template-workers.ts
  • Loading branch information
JacobMGEvans committed Apr 8, 2022
1 parent f72c943 commit 743d6b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-turtles-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

fix: the pathing for the template was resolving using `__dirname` into the esbuild file which then used a relative path back from pages. When ran inside a test would get a resolved absolute path to the template from "pages/pages/functions/template-workers.ts
4 changes: 1 addition & 3 deletions packages/wrangler/pages/functions/buildWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ export function buildWorker({
onEnd = () => {},
}: Options) {
return build({
entryPoints: [
path.resolve(__dirname, "../pages/functions/template-worker.ts"),
],
entryPoints: [path.resolve(__dirname, "./template-worker.ts")],
inject: [routesModule],
bundle: true,
format: "esm",
Expand Down

0 comments on commit 743d6b2

Please sign in to comment.