Replies: 5 comments 10 replies
-
|
Add to |
Beta Was this translation helpful? Give feedback.
-
|
index.html and Project Root |
Beta Was this translation helpful? Give feedback.
-
|
import path from 'path' export default {
root: './',
build: {
rollupOptions: {
- input: 'src/index.html',
+ input: path.join(__dirname, 'src/index.html'),
},
},
}I try to use absolute path of input, it's worked! |
Beta Was this translation helpful? Give feedback.
-
|
Got the same issue. Can't make it working after moving |
Beta Was this translation helpful? Give feedback.
-
|
I find this rather confusing: Instead of specifying the path to index.html we have t specify a root and then change everything else. Feels verbose and unnecessarily complex for what people are trying to do. But I guess I just bite the bullet and go with the default with index.html outside of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
There is plenty of reasoning why
index.htmlis not inpublic(for example here in the official docs) but there isn't any explanation why it isn't insrc. @yyx990803 even explicitly says here:So then why isn't it in
src?Especially since nowadays the repository root is usually used for config files (
.editorconfig,vite.config.ts, etc.) whichindex.htmlis arguably not.Beta Was this translation helpful? Give feedback.
All reactions