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

Set esbuild main fields to properly bundle Svelte components from npm #114

Merged
merged 1 commit into from
Mar 1, 2022

Commits on Mar 1, 2022

  1. Update README.md

    Was about to open a bug report, but this seems to fix my problem:
    
    I'm currently running into sveltejs/svelte#6600
    
    Basically I want to use a Svelte component from npm, but esbuild will look at `main`/ `browser` and include the compiled version. But it needs to load the raw Svelte code. So you end up with two version of Svelte in the same project, causing the crash.
    
    See https://github.com/zerodevx/svelte-toast/blob/281f95da2b6252d6756c053e302c6bd2a645ddb7/package.json#L6
    
    And of course esbuild already has a solution, as always: https://esbuild.github.io/api/#main-fields
    
    **FWIW people might be bundling multiple Svelte version all the time and don't realize, because it will only run it conflicts when both use transitions I think**
    Prinzhorn committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    fe49419 View commit details
    Browse the repository at this point in the history