Pages Functions Bundle post-processing
I need to upload Functions bundle's source map to Sentry + post-process both the bundle and its source map to inject Sentry's
AFAIU I need to do the following:
debug-id https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/#3-inject-debug-ids-into-artifactsAFAIU I need to do the following:
- use
wrangler pages functions build --sourcemapto generate the bundle and its source map. - do the necessary post-processing of the generated files
- rename the bundle file to
and put it into the_worker.js./distfolder (output folder for all static files) - run
wrangler pages deploy ./distcommand to deploy Pages. It will ignore./functionsfolder and use
file instead._worker.js
- Is my approach correct?
- Any pitfalls?
- What about routing? In my case Cloudflare won't automatically generate routes based on the
./functionsstructure. What's the effect? - Does it worth documenting such a use case? It's not a trivial workflow and the
wrangler pages functions buildis not documented at all.
Upload your source maps using Sentry CLI.