The documentation state that a symlink must be created so the web server can access assets, but this solution has a few issues for me:
I already have an assets folder in my public directory
I want to import assets from elsewhere (like node_modules) which won’t be available with this technique
I think I was able to achieve the same result without the drawbacks above by using Vite server.origin option instead like stated in the Backend Integration docs:
Just had some time to test it and it seems to work great. I had a request for this, didn't know that this is finally possible! Would be happy if you submit a PR!
The documentation state that a symlink must be created so the web server can access assets, but this solution has a few issues for me:
assets
folder in mypublic
directorynode_modules
) which won’t be available with this techniqueI think I was able to achieve the same result without the drawbacks above by using Vite
server.origin
option instead like stated in the Backend Integration docs:This ensure that assets URL are prefixed with Vite dev server host so they load properly.
Do you see any issue with this approach I would have overlooked? Would you like me to submit a PR to replace the symlink?