1

I've developed a library which has some images.

I'm using file-loader in order to export them in my production into a res folder. So my distribution folder look as follow

./dist
--- my.core.js
--- my.core.css
--+ res
     --- img1.png
     --- img2.png

The problem is when a client uses my library he has to put this res folder in his main url.

My question is how do I make webpack/file-loader search the res folder in relative to the my.core.js. so my clients will simply put my library dist folder where ever they want in their server. without moving the res folder somewhere else.

url-loader is solving my problem, but i do not want to embed my images in my js files

Raziza O
  • 1,560
  • 1
  • 17
  • 37
  • What about base64 encoding the images into the bundle? – glued Dec 31 '17 at 20:40
  • I wrote in my post that `url-loader` doing it for me but i don't want to.. cause this resources might be big, and i don't want the client to "download" all my resources. There are rare used resources also that i don't want to download as long as there is no need for them – Raziza O Jan 02 '18 at 15:51

0 Answers0