The SSR output of astro build, which is located in dist/_worker.js directory, contains files which are not used in SSR and only used for prerendering locally. We should not keep them and upload them to Cloudflare.
The goal is:
not to add a second bundling step
keep the SSR file chunks the same they are after running astro build
making sure unused files & chunks (because they are only needed for prerendering) are removed
if necessary put this under an experimental flag for the adapters options
The SSR output of
astro build
, which is located indist/_worker.js
directory, contains files which are not used in SSR and only used for prerendering locally. We should not keep them and upload them to Cloudflare.The goal is:
astro build
Potential important parts of the code:
https://github.com/withastro/adapters/blob/b153fc4565dd5b5902068e097a38a50f30a67bb8/packages/cloudflare/src/index.ts#L81-L88
https://github.com/withastro/adapters/blob/b153fc4565dd5b5902068e097a38a50f30a67bb8/packages/cloudflare/src/index.ts#L145-L213