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

Respect kit.vite.esbuild config when building with Vercel adapter #1706

Closed
mattjennings opened this issue Jun 18, 2021 · 0 comments · Fixed by #1914
Closed

Respect kit.vite.esbuild config when building with Vercel adapter #1706

mattjennings opened this issue Jun 18, 2021 · 0 comments · Fixed by #1914
Labels
pkg:adapter-vercel Pertaining to the Vercel adapter

Comments

@mattjennings
Copy link

Is your feature request related to a problem? Please describe.
I have a dependency that needs to be excluded from the bundle, so I mark it as external in svelte.config.js like so:

const config = {
  preprocess: preprocess(),

  kit: {
    adapter: vercel(),
    target: '#svelte',
    vite: {
      esbuild: {
        exclude: ['external-dependency']
      }
    }
  }
}

This correctly gets excluded in the .svelte-kit build, but it gets included in the adapter build's output.

Describe the solution you'd like
Use the kit.vite.esbuild settings from svelte.config.js in the adapter build

Describe alternatives you've considered
I noticed the node adapter excludes pkg.dependencies - maybe we just need to do the same for Vercel adapters? Is there a reason for doing that in one adapter and not another?

How important is this feature to you?
Important, I'm unable to deploy until I can exclude this dependency.

@benmccann benmccann added the pkg:adapter-vercel Pertaining to the Vercel adapter label Jun 18, 2021
thmsmlr added a commit to thmsmlr/kit that referenced this issue Jun 21, 2021
This patch attempts to solve sveltejs#1706
We pass through the esbuild configurations in svelte.config.cjs into the
esbuild step of the vercel adapter.

This is primarily to solve the case where we have external packages that
are skipped by esbuild in adapater-node, but not adpater-vercel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:adapter-vercel Pertaining to the Vercel adapter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants