Skip to content
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

chore: externalize cloudflare:sockets imports #409

Merged
merged 6 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/good-rivers-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': minor
---

Improves default config to support `cloudflare:sockets` imports
Copy link
Member

@ematipico ematipico Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: since it's a minor, maybe the changeset should contain more information e.g. what it means for the users and they can do now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it even a breaking change? I don't see how this would break any case that was working. It might change the error in some scenarios, but not add new ones.

8 changes: 8 additions & 0 deletions packages/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ export default function createIntegration(args?: Options): AstroIntegration {
// Allows imports of '.wasm', '.bin', and '.txt' file types
cloudflareModulePlugin,
],
ssr: {
external: ['cloudflare:sockets'],
alexanderniebuhr marked this conversation as resolved.
Show resolved Hide resolved
},
build: {
rollupOptions: {
external: ['cloudflare:sockets'],
alexanderniebuhr marked this conversation as resolved.
Show resolved Hide resolved
},
}
alexanderniebuhr marked this conversation as resolved.
Show resolved Hide resolved
},
integrations: [astroWhen()],
image: setImageConfig(args?.imageService ?? 'compile', config.image, command, logger),
Expand Down
Loading