Why does `wranger pages dev` watch the output directory changes instead of source?

Hi all šŸ‘‹ When I run wranger pages dev, it only rebuilds when something changes in my output directory, build. How do I get it to rebuild when something in my source directory, src changes? My directory structure looks like:
ļ„• src
ā”œā”€ā”€ ļ„• worker
ā”‚ ā””ā”€ā”€ ī˜Ø handler.ts
ā””ā”€ā”€ ī˜Ø _worker.ts
ļ„• build
ā”œā”€ā”€ ļ„• worker
ā”‚ ā””ā”€ā”€ īŽ handler.js
ā””ā”€ā”€ īŽ _worker.js
ļ„• src
ā”œā”€ā”€ ļ„• worker
ā”‚ ā””ā”€ā”€ ī˜Ø handler.ts
ā””ā”€ā”€ ī˜Ø _worker.ts
ļ„• build
ā”œā”€ā”€ ļ„• worker
ā”‚ ā””ā”€ā”€ īŽ handler.js
ā””ā”€ā”€ īŽ _worker.js
And npm run build just runs tsc --outDir build to compile all of the stuff in src to the corresponding JS file in build wrangler.toml:
name = "my-proj"
pages_build_output_dir = "build"
compatibility_date = "2024-07-24"

[env]
production = { }
name = "my-proj"
pages_build_output_dir = "build"
compatibility_date = "2024-07-24"

[env]
production = { }
1 Reply
aaronj1335
aaronj1335OPā€¢5mo ago
I'm using "advanced mode" instead of a functions directory, and this bit of source code in wrangler seems to imply that I can't really configure this, but I might be missing something. Alternatively, can I have a single file in the functions directory that matches every path (even nested directories)?
Want results from more Discord servers?
Add your server