-
Notifications
You must be signed in to change notification settings - Fork 122
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
base path URL is not configurable #151
Comments
Hi Yann!
Hosting a Rails app in a nested path is unusual, but I think it makes sense to add a separate {
"all": {
"watchAdditionalPaths": [],
},
"production": {
"base": "my-app"
}
} Let me know if you would be willing to rework #152 to add the const base = `${assetHostWithProtocol || config.base}/${config.publicOutputDir}/` It would also make sense to allow configuring this setting using environment variables, like for other settings ( "base": "", |
Released Run Thanks! 😃 |
Is your feature request related to a problem? Please describe.
I have a RoR app running on https://example.com/my-app
When I compile the assets for production, URLs used in my CSS are incorrect: expected
/my-app/vite/assets/foo.png
, got/vite/assets/foo.png
. this issue is normal since my vite configuration is incomplete.According to the vite documentation, the public base path is the solution. Let's tweak the configuration:
It looks like
RubyPlugin()
overwrites my custom configuration. Let's find another way.I read through the vite-ruby doc and found the assetHost property:
We're getting close to what I would expect. However, the two leading slashes annoy me. After some research in your code the slashes are added in config.ts:103
Describe the solution you'd like
base
propertyOr
The text was updated successfully, but these errors were encountered: