-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support to @astrojs/cloudflare
directory deploy mode
#3806
Conversation
🦋 Changeset detectedLatest commit: a1aa4a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
6773126
to
fbc6a84
Compare
fbc6a84
to
716e705
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks!
@nrgnrg sorry for the late review. Would you mind rebasing with main? We can then get this in. |
ea9cce4
to
6c05ac4
Compare
6c05ac4
to
7e985f4
Compare
Very happy to see this change: I was actually just discussing the merits of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once tests are passing!
Changes
Cloudflare Pages has 2 different ways of deploying a worker, the default mode which looks for a
functions
folder in the project root and anadvanced
mode which uses a_worker.js
in thedist
directory.Different frameworks have opted for different approaches: Sveltkit targets advanced mode where as SolidStart and Qwik both target the functions directory.
Advanced mode provides a more consistant experience for users since the entire project gets built into the
dist
folder which is familiar. However the limitation of this is that pages plugins can't be used. As I see it a major use case for pages plugins is for enabling things like Sentry, especially in the absence of any logs on the pages platform right now.This change adds an option to the adaptor to enable uses to change the default
advanced
deploy mode to the functions folder model which would allow the use of pages plugins and middleware. This mode creates a new functions folder in the project root where users can add plugins.Testing
Docs
Updated readme