Closed Fryuni closed 2 months ago
Latest commit: fc0ff552e9007cc9bf0d8f16644cbf9ba406116f
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
!preview cf-no-prerender-chunks
Snapshots have been released for the following packages:
@astrojs/cloudflare@experimental--cf-no-prerender-chunks
🦋 warn ===============================IMPORTANT!===============================
🦋 warn Packages will be released under the experimental--cf-no-prerender-chunks tag
🦋 warn ----------------------------------------------------------------------
🦋 info npm info @astrojs/cloudflare
🦋 info npm info @astrojs/netlify
🦋 info @astrojs/cloudflare is being published because our local version (0.0.0-cf-no-prerender-chunks-20240412140922) has not been published on npm
🦋 warn @astrojs/netlify is not being published because version 5.2.0 is already published on npm
🦋 info Publishing "@astrojs/cloudflare" at "0.0.0-cf-no-prerender-chunks-20240412140922"
🦋 success packages published successfully:
🦋 @astrojs/cloudflare@0.0.0-cf-no-prerender-chunks-20240412140922
🦋 Creating git tag...
🦋 New tag: @astrojs/cloudflare@0.0.0-cf-no-prerender-chunks-20240412140922
I'm looking at this in reference to https://github.com/withastro/astro/issues/10552 and I'm wondering if this would be better to be in core rather than adapters. The same thing seems to happen for all adapters, and it shouldn't really be the responsibility of an adapter to clean up the build liek this.
We started discussing how to better solve this in core. It is not on a proper thread, just scattered across the #contribute channel, but here is one message related to the topic
@ascorbic take a look at https://github.com/withastro/astro/pull/11245, I'm not totally sure if that fixes the https://github.com/withastro/astro/issues/10552 issue, but it should make this workaround inside the adapter not needed anymore.
@alexanderniebuhr ooh, nice. Thanks for the pointer
Changes
I'm okay with putting this behind a flag (experimental or not), the wiring is quite trivial to make configurable.
Testing
I added an example of an offending project that includes all content collections in the server bundle even though those are only used in pre-rendered pages, causing unnecessary bloat.
Docs
I don't think this needs any docs changes, but happy to document it if others think it does.