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: avoid builtStart during vite optimize #19356

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

patak-dev
Copy link
Member

fix #19316

Description

Continuation from #19347. We started auto calling builtStart on resolveId in Vite 6, so #19347 didn't have any effect.

The PR is also disabling calling buildStart for the custom resolvers. This doesn't change anything, given that we only have two plugins (alias and resolve plugins) that don't have a buildStart hook. Given that we also needs the resolve plugin during optimize, probably a good idea to force disabling autoStart for these too.

I think we should deprecate vite optimize as we wanted and remove the new autoStart param later on.

@patak-dev patak-dev added feat: preview vite preview trigger: preview and removed feat: preview vite preview labels Feb 4, 2025
Copy link

pkg-pr-new bot commented Feb 4, 2025

Open in Stackblitz

npm i https://pkg.pr.new/vite@19356

commit: 8be2091

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

It seems #19347 only fixed when the hash is consistent (when the optimizer didn't run). And I didn't notice that because I didn't run npx vite optimize with --force 🤦.

@patak-dev
Copy link
Member Author

Ya, I forgot about the auto buildStart call. Starting to regret that change, we may want to review it again in Vite 7.

@patak-dev patak-dev merged commit fdb36e0 into main Feb 5, 2025
27 checks passed
@patak-dev patak-dev deleted the fix/avoid-build-start-during-vite-optimize branch February 5, 2025 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

buildStart behavior change in Vite 6 can cause vite optimize to hang
2 participants