Skip to content

Commit

Permalink
fix: pages advanced mode usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nrgnrg authored and petebacondarwin committed Feb 2, 2022
1 parent e151223 commit 85ceb84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .changeset/many-eggs-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"wrangler": patch
---

fix: pages advanced mode usage

Previously in pages projects using advanced mode (a single `_worker.js` or `--script-path` file rather than a `./functions` folder), calling `pages dev` would quit without an error and not launch miniflare.

This change fixes that and enables `pages dev` to be used with pages projects in advanced mode.
3 changes: 2 additions & 1 deletion packages/wrangler/src/pages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,8 @@ export const pages: BuilderCallback<unknown, unknown> = (yargs) => {
scriptPath,
};
} else {
scriptReadyResolve();

const scriptPath =
directory !== undefined
? join(directory, singleWorkerScriptPath)
Expand All @@ -852,7 +854,6 @@ export const pages: BuilderCallback<unknown, unknown> = (yargs) => {
}
}`,
};
scriptReadyResolve();
}
}

Expand Down

0 comments on commit 85ceb84

Please sign in to comment.