How To Change The Assets URL Origin Added by '@vite' Directive - Laravel - Framework Discussion #43117 GitHub
How To Change The Assets URL Origin Added by '@vite' Directive - Laravel - Framework Discussion #43117 GitHub
Category
iagobruno on Jul 10, 2022
🙏 Q&A
I'm trying to deploy an app on Heroku that already uses the new Vite plugin but I'm
getting this "https required" errors: Labels
None yet
4 participants
Trying to solve the problem I noticed that the Vite manifest generated by the build
command doesn't specify the origin or the protocol of the asset urls.
But the @vite directive automatically prepends the site origin in the asset urls.
Is there any way to change this origin or even disable it to prevent these errors and
the assets being loaded?
I even looked here in the repository trying to find where is the logic that formats
these urls but I didn't find anything.
Solution
Recently the Laravel core team added an env variable to customize the assets URL
prefix.
S j t fi thi i bl i d i l
View full answer
1 1 reply
It was the first thing I tried but it didn't work, the assets domain doesn't
change if I change this environment variable.
Solution
Recently the Laravel core team added an env variable to customize the assets URL
prefix.
So just configure this variable in your admin panel:
ASSET_URL=https://your-app.herokuapp.com
Marked as answer 7 👍 6 👎 1 🎉 2 ❤️ 6 2 replies
ASSET_URL this variable really saved me. our app has country prefix in the url.
❤️ 1