Skip to content

Commit

Permalink
Fix: Avoid unnecessary rebuilding pages functions in wrangler pages d…
Browse files Browse the repository at this point in the history
…ev (#3311)
  • Loading branch information
Maximo-Guk authored Jun 5, 2023
1 parent b5b46b4 commit 116d3fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-weeks-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

Fix: Avoid unnecessary rebuilding pages functions in wrangler pages dev
2 changes: 2 additions & 0 deletions packages/wrangler/src/pages/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ export const Handler = async (args: PagesBuildArgs) => {
minify,
sourcemap,
fallbackService,
// This only watches already existing files using the esbuild watching mechanism
// it will not watch new files that are added to the functions directory!
watch,
plugin,
legacyNodeCompat,
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/pages/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export const Handler = async ({
nodejsCompat,
local: true,
sourcemap: true,
watch: true,
watch: false,
onEnd: () => scriptReadyResolve(),
});
} catch (e: unknown) {
Expand Down Expand Up @@ -339,7 +339,7 @@ export const Handler = async ({
outfile: scriptPath,
functionsDirectory,
sourcemap: true,
watch: true,
watch: false,
onEnd,
buildOutputDirectory: directory,
legacyNodeCompat,
Expand Down

0 comments on commit 116d3fd

Please sign in to comment.