I used Yeoman to develop the AngularJS project. I use the "rev" task to make sure my images, scripts, styles, etc. Uniquely identified.
In my AngularJS application, I have a template that is imported using the ng-include directive. My problem is that usemin translates links in each file relative to the file that it translates, but when things turn out to be visualized, they get pulled into my index.html and the browser pulls things in a different relative way.
For example, I have a directory structure that looks like this:
- index.html
- Templates /header.html
- Images /logo.png
header.html is sometimes drawn into index.html and has a link to images / logo.png.
if I put <img src="images/logo.png" /> in header.html, it loads properly on its own, but cannot be translated using usemin.
If I put <img src="../images/logo.png" /> in header.html, usemin will find it and translate it, but it will not find the image once header.html is pulled into index.html.
The usemin documentation says:
If the link is relative, by default , the specified item is considered in the path relative to the current location of the file in the destination directory [emphasis mine]
The default language makes me think that there is a way to say that relative paths should relate to something other than the current file, but I did not find any documentation telling me how to change this behavior.
source share