annotated-webpack-config icon indicating copy to clipboard operation
annotated-webpack-config copied to clipboard

How to load image assets into webpack-dev-server?

Open ilicmarko opened this issue 6 years ago • 0 comments

Referencing this issue https://github.com/nystudio107/craft/issues/27 here

Hi! I nearly got this working. Even with a webpack-dev-server with https and certificate stuff, but then I walked into a problem with hot module reloading and "background-image: url(/img/header1.jpg)" in homepage.pcss.

I cannot get these ones to work: url(/dist/img/header1.jpg) url(/img/header1.jpg) url(../img/header1.jpg) url(../../img/header1.jpg) url(/src/img/header1.jpg)

I peeked here to see if I could get an example of a local image in pcss, but they a pointed towards an cloudfront url: https://github.com/nystudio107/devmode/blob/master/src/css/components/global.pcss

Do you have a solution for this to get it right?

Thanks, Tim

ilicmarko avatar Mar 22 '20 00:03 ilicmarko