This is my file-tree:
|-package.json
|-vite.config.js
|-pages/
|--main/
|---index.html
|---main.js
|--admin/
|---index.html
|---main.js
We know we can create a multi pages in this way:
But if I try to change the structure of files,i couldnt visit the index.html page by localhost:3000 or visit pages/admin/index.html by the url (localhost:3000/admin/index.html) when running script (vite).
Actually I just want to put the files together so I changed the structure of files and paths in vite.config.js,The result is that the pages didn't come out.
// vite.config.js
const { resolve } = require('path')
module.exports = {
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'pages/main/index.html'),
admin: resolve(__dirname, 'pages/admin/index.html')
}
}
}
}