workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🚀 Feature Request: Env var mocking for Pages

Open WalshyDev opened this issue 3 years ago • 2 comments

Describe the solution

We should really add CF_PAGES and other env vars to pages dev (and if we add a build step)

this allows for a more realistic local dev and also helps for detections (like for SvelteKit'a auto adapter)

WalshyDev avatar Jul 09 '22 22:07 WalshyDev

That does make sense. Is CF_PAGES relevant only at build time or runtime?

sidharthachatterjee avatar Jul 13 '22 14:07 sidharthachatterjee

@sidharthachatterjee mostly to build. eg: Adding CF_PAGES to the build command in SvelteKit will allow for using direct uploads with SvelteKit adapter-auto. Without it there is the added step of installing the adapter-cloudflare

Ekwuno avatar Jul 13 '22 16:07 Ekwuno