Hi, during local development, I am trying to use ‘wrangler pages dev’ with ‘npm run dev’ to run my framework build command through wrangler - so wrangler “proxies itself in front of the command”. The Cloudflare documentation says you can do this by using ‘wrangler pages dev – ’.
So I would think the command I should use would be like this:
wrangler pages dev – npm run dev
But when I do that, it doesn’t run the second part - npm run dev. I must be doing something wrong here. Any insight would be greatly appreciated.
Ok, nevermind, I figured it out. Posting my findings here for anyone that stumbles across this in the future.
I found that I was interpreting the docs correctly, but the command did not work the way it said it would - at least for me.
This command:
wrangler pages dev -- npm run dev
Did not work properly. It just ran the wrangler build but not my framework’s build script.
I was able to get it to work by simply adding npx to the front, like this:
npx wrangler pages dev -- npm run dev
I am not sure if this is expected behavior or a bug.