Not sure if this is a bug or the intended behavior of the scaffolding, but shouldn't index.html be in the public directory instead of the project root?
Create a new vite-app and the index.html will be created in the project root.
I think you can specify your root by cli command:
https://github.com/vitejs/vite/blob/12c7c5dabda62bf5745cf0e3c25f609d2cc1438f/src/node/cli.ts#L26
or add root in your vite.config.js( or the config file you tell vite):
https://github.com/vitejs/vite/blob/12c7c5dabda62bf5745cf0e3c25f609d2cc1438f/src/node/cli.ts#L101-L117
Thanks @z3rog for the info. Good to know. My "bug" issue was more referring to the file locations of the initial scaffolding.
Since posting, I also noticed the index.css file is put in src and I would have located that in public instead. Maybe this is because it's being imported by main.js instead of linked in index.html.
I guess I was just wondering if there is a best practice for the location of these non-Vue static files or if it's totally just developer preference. Sorry to be nit-picky, just curious why they are located where they are.
Big Vue fan and excited to start using Vite!
Coming from https://github.com/dominikg/svite/issues/58#issuecomment-695782624.
I think it should be in "public" too.
I'm not sure public would be the right place, as per docs of vite that directory is for static assets that are not referenced elsewhere (eg. robots.txt, favicon.ico) and copied over to output as-is. https://github.com/vitejs/vite#the-public-directory
index.html certainly is not copied but processed.
I agree though that project root dir is not the perfect place. Maybe inside src as index.template.html?
Most helpful comment
I'm not sure public would be the right place, as per docs of vite that directory is for static assets that are not referenced elsewhere (eg. robots.txt, favicon.ico) and copied over to output as-is. https://github.com/vitejs/vite#the-public-directory
index.html certainly is not copied but processed.
I agree though that project root dir is not the perfect place. Maybe inside src as index.template.html?