aaronj1335
aaronj1335
CDCloudflare Developers
Created by aaronj1335 on 7/31/2024 in #pages-help
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 = { }
3 replies