0
votes

i don't know if this answer was asked, but i didn't find a related thread. I build my static page with grunt and after generating my "index.html" under "/dist/index.html" i run with usemin (and useminPrepare) over this file to merge and minify my css and js files which works fine.

But my images which are related in my index.html aren't replaced (and copied from source) ...

For example i want that the following code

<img src="/src/assets/images/my-image.png" width="50" height="50" alt="My alt title" />

is replaced unter /dist/index.html with

<img src="/images/my-image.png" width="50" height="50" alt="My alt title" />

and also the image is copied from /src/assets/images/my-image.png to /dist/images/my-image.png.

How i can achieve this?

Thanks in advance.

1
No one have a solution for this problem? Or have an alternative way to accomplish this? - xyNNN

1 Answers

0
votes

Problem solved by using the node package "grunt-string-replace" (See https://www.npmjs.org/package/grunt-string-replace).