Skip to content

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

Merged
ematipico merged 1 commit into
mainfrom
refactor/middleware-file
Nov 20, 2024
Merged

refactor(build): don't emit middleware.mjs#12479
ematipico merged 1 commit into
mainfrom
refactor/middleware-file

Conversation

@ematipico

Copy link
Copy Markdown
Member

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

changeset-bot Bot commented Nov 19, 2024

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6546bc4

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

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Nov 19, 2024
@codspeed-hq

codspeed-hq Bot commented Nov 19, 2024

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #12479 will not alter performance

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

Summary

✅ 6 untouched benchmarks

@ematipico ematipico merged commit ab0580b into main Nov 20, 2024
@ematipico ematipico deleted the refactor/middleware-file branch November 20, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants