-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
fix: watch build mode infinite build #19922
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
Conversation
Why does the rebuild trigger? If I remember correctly, rollup only runs the rebuild when an imported file is changed. |
When |
I think the problem is that the output overwrites the watched file. If I change the output filename, it doesn't happen. Setting |
We do output warning messages. But if it is in watch mode, because it will be triggered repeatedly, it seems meaningless even if the warning message is output, so in this case, I think it is more reasonable to terminate the process. Do you think it's ok to set output.dir to the default value of dist if it's an empty string? |
Rollup can skip the rebuild if the rebuild if the output overwrites the input. Or can even skip the output and show an error. Setting
I don't think it's ok. Because setting |
At present, it seems that the rebuild is not skipped. Is there any configuration required? |
It's not implemented. I mean it's better to fix on rollup side as there's not enough information on Vite side to do so, and the fix would benefit users in rollup as well. |
Thanks for the detailed response. I will create an issue for rollup. |
Description
When executing
vite build -w
, ifbuild.outDir
is an empty string, it will cause an infinite packaging loop.