change path index.html
Heya! Now, I used vite, that's good, however, I would like to change path first index.html to any path, any folder by not referring to any dependencies.
---public
---- index.html
---src
---- main.ts
---- app.vue
Thanks.
In vite, index.html
is part of your source code. Vite parses/rewrites it during dev and also transforms it in build. Don't put it separate from your source code.
vite also in general do not accommodate any preference based options - if there is no real technical reason to add an option, then it will not be considered.
In vite,
index.html
is part of your source code. Vite parses/rewrites it during dev and also transforms it in build. Don't put it separate from your source code.vite also in general do not accommodate any preference based options - if there is no real technical reason to add an option, then it will not be considered.
I believe that adding a mount option like snowpack will help in organizing as for me I prefer to have public
for static html and robot.txt files and src
for app core and many does as it more like a standard
You can manual add public folder, but vite will not parse it. I add below to my custom.html:
in header:
<script type="module" src="/@vite/client"></script>
<script type="module">
import RefreshRuntime from "/@react-refresh"
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
</script>
in body:
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
then visit http://localhost:3000/public/custom.html
This issue has been locked since it has been closed for more than 14 days.
If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion.