dev: Have webpack clean output directory on startup - #3475
Merged
Conversation
lvachon1
approved these changes
Sep 3, 2026
lvachon1
left a comment
Contributor
There was a problem hiding this comment.
My css directory had around 90k files in it, and in that state startup was extremely slow. I was able to watch webpack slowly delete each file one by one, and at that rate I'd be waiting for hours. After manually cleaning out the css folder from everything *.hot-update.* startup went back to its usual few seconds. This should help keep our filesystems happy, thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves
Error: EMFILE: too many open files, watch 'dotcom/priv/static/css/stop.c6f8a32fa3a07730bd2d.hot-update.js.map'Scope
Asana Ticket:
No ticket, but discussed in Slack
Implementation
Keeps local webpack output folder clean so it doesn't get overwhelmed by hot reload artifacts. Not sure what this incurs in startup costs, if at all (since I assume server rebuilds the initial chunks anyway, emptying out the folder beforehand surely wouldn't add too much time? But if it's building off old chunks, then maybe it's more expensive? Unsure.), but it's probably not a noticeable amount.
Screenshots
N/A
How to test
Observe that
priv/static/csshas many hotreload files. With setting on, observe that starting server cleans out the directory and starts with fresh chunks.