Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic public base path #7560

Closed
4 tasks done
danielroe opened this issue Apr 1, 2022 · 3 comments
Closed
4 tasks done

Dynamic public base path #7560

danielroe opened this issue Apr 1, 2022 · 3 comments

Comments

@danielroe
Copy link
Contributor

danielroe commented Apr 1, 2022

Clear and concise description of the problem

Sometimes we might run a built Vite site in a number of different locations. It would be convenient to have vite support for setting the public base path dynamically rather than just at build time.

Suggested solution

As with __webpack_public_path__, vite could expose a global __vite_public_path__ variable that could be set and would automatically update all asset references throughout the app.

Alternative

We currently implement this in Nuxt using a vite plugin, but it would be great to have built-in support upstream.

I would be very willing to implement this if it's in line with the project roadmap.

Additional context

No response

Validations

@bluwy
Copy link
Member

bluwy commented Apr 1, 2022

Duplicate of #3522 😬 But having built-in support sounds like a great idea to me! Also nice to know there's a Vite plugin that can implement this.

@bluwy bluwy closed this as completed Apr 1, 2022
@danielroe
Copy link
Contributor Author

Thanks @bluwy. I see it's still pending triage, but are you saying you'd welcome a PR?

@bluwy
Copy link
Member

bluwy commented Apr 1, 2022

I actually asked a question there which no-one had answered. I'm assuming you had already considered base: './', and finally when with this approach, and if that's the case it would be good to implement then. Still I would be interested to know if base: './' had worked for you? 🤔

To be safe, I can put this in the team board too and we can discuss about it first.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants