Fixing the Vite watcher memory leak #912
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #908
Looks like maybe Laravel did the same.
From what I could tell, the Vite watcher was watching every single file. There doesn't seem to be a "only watch these folders" so instead I'm doing a "ignore everything except these" and listing just folders where your js/css assets would go. Once I got this into a local project, I got a massive performance boost on loading pages, and no more memory leak error. However, the "logout" link wouldn't work so I had to make the main js_link a
type: "module".The last thing I had to do was tell the
sourcemapto betrueinstead ofinline. I guess the inline option holds it all in memory.Now, with all this working, there is still some weirdness, but I'll open a separate issue on that.