New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to change index.html location but keep root #306
Comments
You can do this with the latest alias improvement in 0.18. Assuming you are placing a // vite.config.js
module.exports = {
root: path.resolve(__dirname, 'playground'),
alias: {
'/package-1/': path.resolve(__dirname, 'packages/package-1'),
'/package-2/': path.resolve(__dirname, 'packages/package-2'),
}
} I also just pushed 8fe4284 which should make HMR work for files that are aliased but out of root. Note you need to import aliased files as |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is your feature request related to a problem? Please describe.
Currently I can either change
root
to a subfolder (which doesn't work for all other folders outside) or haveroot
at the root but it needs anindex.html
in this directory.Something like a monorepo where I have a
/fixture
or/playground
folder for development but it should also watch all other packages in/packages/
. Settingroot
to/playground
works but doesn't include all other files outside.I know monorepo support is currently a future thing but don't know if it's really a monorepo "problem". Is this even possible or does the root need to be always where the
index.html
is?Describe the solution you'd like
Maybe introducing a new option
entry
/indexEntry
to be able to change the location e.g.--entry=./playground/index.html
or from thevite.config.ts
.Additional context
Current project structure:
The text was updated successfully, but these errors were encountered: