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

fix: improve fallbacks #13

Merged
merged 2 commits into from
Nov 29, 2024
Merged

fix: improve fallbacks #13

merged 2 commits into from
Nov 29, 2024

Conversation

benmccann
Copy link
Owner

@benmccann benmccann commented Nov 28, 2024

Vite defines conditions when bundling and the fallback is only hit when not bundling, so the import.meta.env.DEV doesn't do anything and can be removed

Conditions should be set during bundling. We can update rollup-plugin-svelte and svelte-loader to enforce that they are. Users should always have one of either development or production set. If neither are set, then we know something is wrong. We also know something is wrong in the svelte plugins if the the svelte condition doesn't get set

The fallbacks can't be tree-shaken, but can only be hit when not bundling in which case we don't need tree-shaking anyway

Copy link

changeset-bot bot commented Nov 28, 2024

🦋 Changeset detected

Latest commit: b161767

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

This PR includes changesets to release 1 package
Name Type
esm-env Patch

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

@benmccann benmccann changed the title chore: remove condition that will never be triggered fix: improve fallbacks Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants