Skip to content

dev: Have webpack clean output directory on startup - #3475

Merged
jlucytan merged 1 commit into
mainfrom
jlt/qf/webpack-clean
Sep 3, 2026
Merged

dev: Have webpack clean output directory on startup#3475
jlucytan merged 1 commit into
mainfrom
jlt/qf/webpack-clean

Conversation

@jlucytan

@jlucytan jlucytan commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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/css has many hotreload files. With setting on, observe that starting server cleans out the directory and starts with fresh chunks.

@jlucytan
jlucytan requested a review from a team as a code owner September 3, 2026 15:47
@jlucytan
jlucytan requested a review from lvachon1 September 3, 2026 15:47

@lvachon1 lvachon1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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!

@jlucytan
jlucytan merged commit f5dcba2 into main Sep 3, 2026
29 checks passed
@jlucytan
jlucytan deleted the jlt/qf/webpack-clean branch September 3, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants