How to store all vite entry points in the same non-root folder?
04:19 16 Jul 2025

I have the following structure

│   vite.config.ts
│   index.html
│
└───admin
│   │ index.html
│
└───info
    │ index.html

With this in vite.config.ts

build: {
    target: "esnext",
    rollupOptions: {
        input: {
            main: resolve(__dirname, "index.html"),
            admin: resolve(__dirname, "admin/index.html"),
            info: resolve(__dirname, "info/index.html")
        }
    }
}

But I would like to keep all those entry point files in a single folder if possible, something like this:

│ vite.config.ts
│
└───entry
      │   index.html
      └───info
      │   │ index.html
      └───admin
          │ index.html

But when I try updating my rollupOptions to the below, I just get redirected to the main index.html:

build: {
    target: "esnext",
    rollupOptions: {
        input: {
            main: resolve(__dirname, "entry/index.html"),
            admin: resolve(__dirname, "entry/admin/index.html"),
            info: resolve(__dirname, "entry/info/index.html")
        }
    }
}

Is there a way of achieving what I want, or similar? It seems weird if we are forced to have every entry point in its own folder in the root directory - I would rather keep them all together in their own folder.

vuejs3 vite entry-point