withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.93k stars 2.49k forks source link

refactor(build): don't emit `middleware.mjs` #12479

Closed ematipico closed 2 days ago

ematipico commented 2 days ago

Changes

This PR refactors our build by removing the necessity of having a file called middleware.mjs. We were emitting middleware.mjs in order to have a predictable way to load the middleware file; however, since we started emitting the middleware chunk as a virtual module, we were emitting two files: middleware.mjs that simply do an export of onRequest from the middleware chunk.

middleware.mjs isn't needed anymore, and we directly import the chunk that rollup generates after the build.

Testing

This is an internal refactor; existing CI should pass, and no changeset is needed.

Docs

N/A

changeset-bot[bot] commented 2 days ago

⚠️ No Changeset found

Latest commit: 6546bc43a37bb3769306a07622cf944e346153cd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

codspeed-hq[bot] commented 2 days ago

CodSpeed Performance Report

Merging #12479 will not alter performance

Comparing refactor/middleware-file (6546bc4) with main (46f6b38)

Summary

✅ 6 untouched benchmarks