vite icon indicating copy to clipboard operation
vite copied to clipboard

Support for Mounts

Open Snugug opened this issue 3 years ago • 1 comments

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

Snugug avatar May 14 '21 18:05 Snugug

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.

jryans avatar Oct 08 '21 17:10 jryans

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.

bluwy avatar Dec 29 '22 17:12 bluwy