Skip to content

Conversation

@allezxandre
Copy link
Contributor

This PR exposes the external ESBuild option from the adapter-cloudflare package.

Had a 3rd party package importing some node-native modules without the node: prefix, making the build fail.

Providing externals to the adapter's build step like the following allowed me to build:

esbuildOptions: {
    external: ["fs", "crypto", "url", "os", "path", "stream", "zlib", "net", "tls", "http", "https"]
}

Might help the following issues:

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

@changeset-bot
Copy link

changeset-bot bot commented Jun 7, 2023

🦋 Changeset detected

Latest commit: 16b7391

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/adapter-cloudflare Minor

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

@allezxandre
Copy link
Contributor Author

In the following issue:

the external build option might have helped as a temporary workaround while waiting for Stripe to fix their package imports

*
* @default {}
*/
esbuildOptions?: {
Copy link
Member

Choose a reason for hiding this comment

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

please see my comment here: #10424 (comment)

@benmccann
Copy link
Member

I'm going to close this in favor of #10424, which seems closer to being ready to merge

@benmccann benmccann closed this Aug 2, 2023
@mgibbs189 mgibbs189 mentioned this pull request Jan 18, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants