vite
vite copied to clipboard
Support for Mounts
Clear and concise description of the problem
As a developer looking to use a tool to compile my HTML, like 11ty, I'd like to keep the compiled HTML directory separate from my asset directory so I don't need to juggle my compiled HTML in my Vite root.
Suggested solution
Add support for something similar to Snowpack mounts
Alternative
My current solution is compiling my HTML into my project root. git ignoring the compiled HTML, and deleting all of the compiled HTML using globing and then finding and deleting just the empty directories, which can be unreliable.
Additional context
Full configuration for this is available in this blog post
I also need something like this as part of migrating from Snowpack to Vite. For the moment, I am using a basic resolveId
plugin to redirect the mounted path to the files on disk, which is okay for my needs.
I think instead of another option, it would be better if this can be solved through a Vite plugin by mapping virtual HTML files to separate 11ty HTML files. This is blocked by https://github.com/vitejs/vite/issues/2321 however, but we could close this in favour of that issue.