-
-
Notifications
You must be signed in to change notification settings - Fork 382
Open
Description
Bug Description
When writeToDisk is set to true Webpack will emit to the default outputFileSystem (normally not memfs due to this logic), and then when the assetEmitted hook fires webpack-dev-middleware also writes the file to the same location (Compiler code, dev middlerware code).
I know there might be some case where someone provides a custom outputFileSystem, but for the common case this seems like a waste, no? I picked this up while debugging storybook.
Link to Minimal Reproduction and step to reproduce
https://github.com/AdrianBannister/webpack-dev-middleware-bug-report
Steps:
- npm install
- node test.js
- See two console.log messages for the same file being written twice
Expected Behavior
Not to write twice when writeToDisk: true
Actual Behavior
Writing twice to disk for the same file and content.
Environment
System:
OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
CPU: (8) x64 Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz
Memory: 47.58 GB / 61.80 GB
Binaries:
Node: 24.12.0
Yarn: 1.22.22
npm: 11.6.2Is this a regression?
No
Last Working Version
No response
Additional Context
I guess you could say this was "broken" in this PR #1537
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels