webpack-dev-server icon indicating copy to clipboard operation
webpack-dev-server copied to clipboard

image link breaks after updating scss with html-loader

Open jderijke opened this issue 2 years ago • 0 comments

Bug report

When I start the page in the small attached project using webpack-dev-server the page is displayed as expected.. When webpack reloads the project, image links break. Images are loaded by html-loader. Issue is also reported here: https://stackoverflow.com/questions/72498866/webpack-images-disappear-after-css-changes-using-webpack-dev-server

Actual Behavior

When I start the page in the small attached project using webpack-dev-server the page is displayed as expected. When I change something (e.g. a margin in scss), webpack reloads the project, when I refresh the page image links are broken.

Expected Behavior

When I refresh the page images should still be there.

The problem does NOT appear if i first build and then run webpack-dev-server, probably because webpack-dev-server can fallback on the image that is generated in dist. So there is a workaround but it still is annoying.

How Do We Reproduce?

Reproduce (in attached small project) q2.zip

npm i npm start

change a margin in scss

reload page in browser

Please paste the results of npx webpack-cli info here, and mention other relevant information

jderijke avatar Jun 11 '22 08:06 jderijke