Vite: index.html and project root
12 February 2026 (Updated 12 February 2026)
During development, Vite is a HTTP server and index.html is the entry point to your application.
Vite treats index.html as source code and part of the module graph. It resolves any <script type="module" src="..."> code that references your JavaScript source code.
SImilar to static HTTP servers like Apache or Nginx, Vite has the concept of a “root directory” which your files are served from. This root directory is references as <root> in the Vite docs.
By default, the root directory is the current working directory but you can change it with a command like vite serve <project-root>.
Tagged:
Vite