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

Disable Vite optimizer for sync and config loading #6902

Merged
merged 1 commit into from
Apr 25, 2023
Merged

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Apr 24, 2023

Changes

Disable the optimizer with optimizeDeps.disabled so that the optimize metadata is not overwritten

Explanation

In the astro docs repo, what's happening is that:

  1. Load astro.config.ts with Vite server, sees ./node_modules/.vite/deps/_metadata.json, but hash mismatched so remove the file.
  2. Start Astro dev server, which sees that there's no ./node_modules/.vite/deps/_metadata.json.

This causes the Astro dev server startup to always re-optimize on step 2, which makes startup slow. This PR prevents step 1 from happening.

Result

This removes 200ms of scanning and 600ms of prebundling for the Astro docs repo for warm startups.

Testing

Manual testing in astro docs repo

Docs

n/a. bug fix.

@changeset-bot
Copy link

changeset-bot bot commented Apr 24, 2023

🦋 Changeset detected

Latest commit: 36a2e5e

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 Apr 24, 2023
@bluwy bluwy mentioned this pull request Apr 24, 2023
Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

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

Awesome!

@bluwy bluwy merged commit 0afff32 into main Apr 25, 2023
@bluwy bluwy deleted the disable-optimizer branch April 25, 2023 12:54
@astrobot-houston astrobot-houston mentioned this pull request Apr 25, 2023
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.

None yet

2 participants