-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
**--watch** mode does full re-build instead of incremental build #16104
Comments
Start a new pull request in StackBlitz Codeflow. |
@Ruthvik94 Hi! Did you managed to figure it out? I'm facing the same problem and managed to find that vite should support incremental builds but nothing on re-builds. Same with Rollup. |
Nope, haven't figured out yet whether it's some config I'm missing that's causing re-builds every time. There's no clarity in docs as well. |
also having these issues after migrating a large project from webpack to vite |
@pyrbin @Ruthvik94 @AdamcOkay Hey folks! We were also wondering about this and found a rollup plugin that did it, but it didn't work quite right with Vite. So we made a true incremental plugin (& wrapper) for Vite and it's been working beautifully for us! Some stats for reference:
For Vite folks reading this: When rolldown comes around, if we can have an option to build in "transpile only" mode, that would allow us to rebuild only the modified file without needing to also build the modules that it imports and would speed this up even more. |
@Samydookie thanks for your work! It seems doing what you told, but in our case we are working on a Vite library using next.js and React 18 (as peer deps). |
@Luk-z Oh yep we will need to follow the original entries object on rebuilds, which we currently don't do. I will add support for that very soon, you can add an issue on the GitHub project if you'd like and I'll close it when the version with the fix gets published |
These two descriptions don't match. Is the issue that subsequent builds aren't as fast as expected? I ran the repro locally, and I can see that subsequent builds are faster than the initial build (1.7s vs 7.8s). I'm not really sure if there's anything actionable here. We're using |
Describe the bug
Issue is, Webpack v5 does a build, emits files and watches for changes. On any change, the rebuild happens almost instantaneously.
Whereas in Vite, build happens successfully and watches for changes. On change, it's a full rebuild taking more time than initial first build rather than doing incremental build.
Closed the existing issue #16048 and created a new one for the same bug
Reproduction
https://stackblitz.com/edit/vitejs-vite-1ytjiw
Steps to reproduce
Intially run command
Time it takes to build is around ~10s. Modify a file and check the build time, it's around ~4s.
Stop the server and now run
Intial build roughly takes the same amount of time. Modify a file and check the build time, it's less than ~1s around 600ms.
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: