WARN Instead of /public/index.html, use /index.html
In accordance to the readme, I have this config:
createHtmlPlugin({
entry: 'src/main.ts',
template: env.VITE_MODE == 'prod' ? 'public/index.prod.html' : 'public/index.html'
})
It works, but I'm getting this warning from vite:
WARN files in the public directory are served at the root path.
Instead of /public/index.html, use /index.html.
I tried going with /index.html, but then the only thing I see is a blank page. It seems that script is not being injected.
Any Ideas for a fix? Thanks.
I noticed, that if I manually include
<script type="module" src="/src/main.ts"></script>
in index.html, it works as expected.
But no matter what I do with the entry field inside config, it fails to auto-inject.
I have the same problem. How can I solve it
same issue public/index.html with <script type="module" src="/src/main.ts"></script>
auto-inject not working