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

Exclude astro from Vite optimization #5545

Merged
merged 1 commit into from Dec 6, 2022
Merged

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Dec 6, 2022

Changes

The Astro package and subpaths shouldn't be prebundled as they are node-only, Astro components, types, or internal files.

Fixes #5517 but short-term only. The better approach which I can do soon is to have Vite's scanner recognize --- as searches imports there. That way we can set the optimizeDeps.entries as src/pages/**/* and it should work properly.

The issue with #5517 is that they put config subfiles in src and that makes Vite prebundle the scanned dependencies (which are almost always not used)

Testing

Tested locally with the repro in #5517. Realistically someone shouldn't import astro in their codebase but it could happen indirectly like in the issue.

Docs

n/a bug fix

@changeset-bot
Copy link

changeset-bot bot commented Dec 6, 2022

🦋 Changeset detected

Latest commit: 68b87d4

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

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Dec 6, 2022
@matthewp matthewp merged commit 9082a85 into main Dec 6, 2022
@matthewp matthewp deleted the exclude-astro-optimization branch December 6, 2022 16:53
@astrobot-houston astrobot-houston mentioned this pull request Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Top-level await is not available when updating pnpm lock
2 participants