adonisjs / vite

Vite plugin for AdonisJS
MIT License
42 stars 5 forks source link

It's not possible to output ressource URLs as absolute paths in Development #17

Open svenhoerig opened 1 week ago

svenhoerig commented 1 week ago

Package version

3.0.0

Describe the bug

In my project (AdonisJS 6 + Vite) I have the situation that the resource URLs have to be output as absolute URLs. The resources are integrated into the HTML using @vite(['resources/css/app.css', 'resources/js/app.js']). But all my attempts have failed, the CSS and JS files are always, at least in development mode, only integrated as relative and not absolute URLs.

vite-screenshot

My use case is, that I have an edge Template which I use to generate a PDF file. In the PDF file the URLs have to be absolute URLs, thats why my resource URLs have to be outputted as absolute URLs.

Reproduction repo

No response

thetutlage commented 1 week ago

I think you can use the assetsUrl option. https://docs.adonisjs.com/guides/basics/vite#deploying-assets-to-a-cdn