vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
68.92k stars 6.23k forks source link

Support the package.json homepage attribute #18783

Open claytron5000 opened 2 days ago

claytron5000 commented 2 days ago

Description

As a developer, I would like to designate the path through which all asset requests go. For example, if I deploy the app to an unknown subfolder, I'd like to add "homepage": "./", thus making all asset paths relative to the current path: "./asset/resource-name.css".

Suggested solution

The entry to the initial assets is written into the index.html file. My rough assumption is we could prepend the homepage string to those asset paths. I'm sure this is not the whole story, since there are cascading requests to get more assets.

Alternative

No response

Additional context

No response

Validations

sapphi-red commented 1 day ago

I guess base: './' is what you are looking for.