Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple entry points in Vite for dev server mode?

Tags:

vite

Is it possible to get multiple html entry points to work in Vite when running it as a dev server (with vite --host)? I'm currently using this post's solution Multiple entry points in Vite, but it only works for when building the site to a dist folder.

like image 702
Atlinx Avatar asked Apr 29 '26 13:04

Atlinx


1 Answers

For anyone coming here with same question. Taken from Vite guide

Suppose you have the following source code structure:

├── package.json
├── vite.config.js
├── index.html
├── main.js
└── nested
    ├── index.html
    └── nested.js

During dev, simply navigate or link to /nested/ - it works as expected, just like for a normal static file server.

like image 95
Jose Antelo Avatar answered May 03 '26 00:05

Jose Antelo