-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? # to your account
When using favicon + output.clean + webpack-dev-server, the second compile loses the favicon #1639
Comments
Noticed same behavior.
But build works as expected. |
I'm noticing the same behaviour - after a reload caused by changes, .png and .svg are no longer served from
|
The issue seems to also affect new CleanWebpackPlugin({
cleanAfterEveryBuildPatterns: ['!**/favicon.ico'],
}), |
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
activity |
Any update on this issue? Seems like it might be related to #1709. |
For me - add testcases from #1709 |
Fixed the original problem, we still need to reemit all assets from child compilation, I try to fix it today and make a release |
Fixed in main, want to add a couple test cases and do release |
Hi, is the release with the fix already out? I saw there was only 5.5.3 (2023-06-10) as last release. |
@nk11dev Sorry for delay, release will be tomorrow |
π Can we help on anything for the release? |
Current behaviour π£
When using a favicon, `output.clean = true, and webpack-dev-server, the favicon is available after startup compile, but after the second compile it is no longer served (404 error).
Expected behaviour βοΈ
My expectation is that the favicon should still be available on subsequent compiles.
Reproduction Example πΎ
I have a full example here: https://github.com/hiddenwaffle/favicon-clean . To run:
npx webpack serve
.The main.js and favicon.ico files are trivial. Below is the webpack config:
As a workaround, I can comment out
contentBase: false
which allows webpack-dev-server to serve the favicon from the file system. Another workaround is that I can move the clean to a production-only config.I tried looking around the html-webpack-plugin to see if I could find anything. I noticed that if I commented out these lines in the html-webpack-plugin index.js file, things seemed to work (obviously not a good fix but hopefully it helps with understanding the nature of the issue):
I also saw that the function that emits the favicon run only once (on startup), and that makes me think that the reason it works when cleaning is off is because the webserver still has a copy. Perhaps the favicon should be emitted as many times as the index.html is?
Environment π₯
Please let me know if there is more I can do to help.
The text was updated successfully, but these errors were encountered: