FranckFreiburger / http-vue-loader

load .vue files from your html/js
MIT License
1.49k stars 275 forks source link

Ability to specify base path (e.g. for template image assets etc) ? #44

Open sp00x opened 6 years ago

sp00x commented 6 years ago

If there is a reference to an image asset within the template it seems the path is resolved relative to the initial Vue app, e.g. if the app is at localhost:8080/ and the .vue file is loaded from somewhere else but has e.g. <img src="assets/foo.png">, then that is resolved as localhost:8080/assets/foo.png

Is there any way of setting an additional "base path" per template loaded via http-vue-loader ?

OmgImAlexis commented 6 years ago

Do you have the base url set for your page?

sp00x commented 6 years ago

@OmgImAlexis That's not relevant or usable for me here, because the base of my main page is different than the base of the templates, which are loaded from different locations (long story).

Eg. my main page is at http://serv.er/xyz but temlplate assets might be at http://serv.er/xyz/some/where/else (for one template) and http://serv.er/xyz/or/even/here (for another template).

Right now all references are relative to the main page, so I have to inject the assets path as a prop into the templates so they know where to get their stuff at.