vite.config.ts base: './' not applied
tomer-zadara opened this issue Β· comments
- [V] I have tried upgrading by running
bundle update vite_ruby
. - [V] I have read the troubleshooting section before opening an issue.
Description π
My ruby on rails with vite application, has GUI that can be launched from root URL or from within a reverse-proxy app under a relative URL.
In vite.config.ts, after setting configuration base: './', rebuilding vite and assets and restarting GUI service, assets URLs are still absolute, like vite_javascript_tag produces URLs starting with forward slash "/vite/assets/application.xxxx.js" and "/vite/assets/application.xxxx.css", and css url() files are absolute as well.
We cannot upgrade vite to version 5, because it requires nodejs 18, which requires glibc 2.28, which requires us to upgrade from ubuntu 18.04 to 20.
Reproduction π
Vite Ruby Info
Run bin/rake vite:info
and provide the output:
Running via Spring preloader in process 535
bin/vite present?: true
vite_ruby: 3.3.4
vite_rails: 3.0.17
rails: 6.1.7.4
node: v16.20.2
npm: 8.19.4
yarn: 1.22.19
pnpm:
ruby: ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux]
installed packages:
Zadara-VSA-GUI@ /home/ubuntu/Zadara-VSA-GUI
βββ¬ @vitejs/plugin-react-swc@3.6.0
β βββ vite@4.5.2 deduped
βββ¬ @vitejs/plugin-react@4.2.1
β βββ vite@4.5.2 deduped
βββ¬ vite-plugin-eslint@1.8.1
β βββ vite@4.5.2 deduped
βββ¬ vite-plugin-ruby@3.2.2
β βββ vite@4.5.2 deduped
βββ vite@4.5.2
@ElMassimo
GitHub source code shows the prefix_vite_asset function always precedes assets path with forward slash in development:
vite_ruby/vite_ruby/lib/vite_ruby/manifest.rb
Line 137 in c726a16
Also here:
vite_ruby/vite-plugin-ruby/src/config.ts
Line 104 in 981d69d