ixkaito / astro-relative-links

Build Astro with relative links.
MIT License
76 stars 5 forks source link

astro dev support #13

Closed nlvw closed 2 months ago

nlvw commented 9 months ago

Is it possible to get this to work with astro dev?

I use a project called code-server which proxies ports through a '/proxy/portnumber' url. So when running the url of the homepage would look something like http://localhost:4080/proxy/4321/. Since the proxy port can change relative paths are needed.

This project works fine when doing astro build then astro preview, however astro dev doesn't work at all. All of the asset's ignore the relative paths ans use absolute paths such as http://localhost:4080/node_modules when it should be http://localhost:4080/proxy/4321/node_modules

wendevlin commented 5 months ago

Hello,

I think a base path should help you: https://docs.astro.build/en/reference/configuration-reference/#base

ixkaito commented 2 months ago

Thanks @wendevlin !

@nlvw I also think the base config should help you.

Please check the "With base config" section in the README.