I have some html popups in a build which work fine in local builds when referenced by src="/products/resistor-2/index.html" but once the build is on a server, it looks for that full address.
I want to put the live server addresses in either at build time when exported e.g.
On Build >
Append "/products/⦠with āwww.livewebsite.com/ā so it is āwww.livewebsite.com/products/ā
Or alternatively, in the actual source html files, I add the full server urls āwww.livewebsite.com/products/ā but have some rule that while in development or local server only, overwrite that āwww.livewebsite.com/ā bit with ālocalhostā or just remove that bit of the line completely locally so local server runs use the local files?
Not sure which is the best approach here
https://stackoverflow.com/questions/68754394/replace-url-during-build-step-of-npm
Original Post on Discord
by user 103054507105067008
Hey Rob, are you sure this is related to Needle Engine?
We wonāt be able to give support on each and any regular webdev question 
Could be wrong URLs (usually thereās a . at the beginning), could be wrong setup (vite for example does that automatically - are you using vite here?), could be something else, but it doesnāt sound needle related.
For sure, I might ask about it on stackoverflow, is there any plan to have a section of a forum here just for general web dev chat? Iāve been having a lot of fun working with other Needle devs figuring this stuff out, I understand it isnāt Needle related
by user 103054507105067008
Iām using Vite too so Iāll start looking into what it does there
by user 103054507105067008
We can do that, sure!
Generally vite will keep the relative URLs. If you want a server relative URL, use ./products. If you want a URL relative to your page, use /products.
Iāll give that a shot and ping back if it worked, the clientās web designer who gave me the html files didnāt know much about vite either so they set up those urls for sub pages without the . before /products/ and other sub pages
by user 103054507105067008
Thatād be brilliant, I had help from other developers here when I was setting up post processing with Needle before too and want to keep sharing the tips and things I find as I use it in projects. Iām also tasked at work to sort out some AR preset move/scale/rotate functionality that Iād like to share to you guys and other devs for samples 
by user 103054507105067008
thatās not related to vite, thatās just how URIs work 
I can confirm your suggested fix of ā./productsā instead of ā/productsā worked, and also āā¦/ā¦/imagesā worked for parent folders perfectly too
by user 103054507105067008