-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
output.clean : true
is not working with dev server
#861
Comments
I have ideas how we can fix it, but need more time, idea:
so we will have layer layered file system (memory + real fs) |
I can reproduce the problem with Webpack output: {
clean: true,
},
devServer: {
writeToDisk: true,
}, |
I can reproduce that too with
|
Any updates on this? Still an issue with |
No, it will be fixed in near future, we need layer fs |
the |
Same problem on webpack 5.65.0 and webpack-dev-server 4.6.0 |
Yoooo, still nothing? xD |
I just keep using clean-webpack-plugin then. |
:( |
Still a bug as of |
9 months later and still nothing. Is this "near future"? Still happening with |
Still happening for me with |
Hello :) When I use webpack from cli, it works. Clean Webpack Plugin works fine from cli & from middleware. webpack : 5.74.0 |
Still happens with me as well |
Interesting note, I've been using Clean Webpack Plugin while waiting for a solution here, but noticed that after initial bundling, an asset is still available on the localhost even though it's not shown in the file tree. I can still access that asset directly by visiting the link to it in the browser. This was resolved when I set the |
Still an issue with Clean Webpack Plugin isn't working for me either. I'm not sure if it's because my path is not a static path, as it is based on a version number from the previous git commit, so I have multiple
|
Sorry for delay, I am looking for a solution before the next webpack-dev-server release (with the latest version of @AaronMcCloskey It doesn't work because you use Based on your configuration it is expected, so you allow to download old version of your application, anyway if you want to make it work you need to specify |
Fixed: when you have
|
@alexander-akait |
@olosegres Please provide reproducible test repo, |
Bug report
What is the current behavior?
output.clean: true
is not working with webpack dev server, when building for the first time, or when project is rebuilding due to sources change.Description
I was trying to configure webpack to clean the dis folder for one of my projects, and decided to use brand new output.clean configuration as I'm using
"webpack": "^5.21.2"
and this config is supported starting from version 5.20Config works fine in production build, but when I start webpack dev server with
writeToDisk: true
webpack doesn't clean thedist/
directory neither upon the start of the dev server nor upon project rebuild.Initially I though that it might be not supposed to work with dev server, but changing
to
does log what files it should delete when rebuilding project:
If the current behavior is a bug, please provide the steps to reproduce.
npm i
in the root of the repositorynpm start
to start the applicationsrc/App.js
and make any change so that webpack catch it up and rebuild the projectExpected behavior:
old files from
dist/
folder should me removed, anddist/
folder should contain one instance of each bundled fileCurrent behavior:
dist/
folder is not being cleaned, and contains several files for each bundled files:What is the expected behavior?
old files from
dist/
folder should me removed, anddist/
folder should contain one instance of each bundled fileOther relevant information:
webpack version:
webpack 5.27.1
Node.js version:
v14.15.0
Operating System:
macOs Catalina Version 10.15.7
Additional tools:
This issue was moved from webpack/webpack#12949 by @alexander-akait. Original issue was by @vovkvlad.
The text was updated successfully, but these errors were encountered: