You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, let me introduce the use case scenario. Vite is already powerful enough, but for our company's development, many project configurations are quite similar. I don't want to make the same basic configurations for every project, as that would make maintenance and updates extremely difficult later on. So I had a bold idea: I want to encapsulate most of the agreed-upon Vite configurations (including index.html) through a library project, so that new projects only need to reference this library and can quickly start and develop with minimal or even no configuration.
Everything went very smoothly, except for one point that got stuck, which is the handling of index.html. In fact, the build process is fine; it's just that the dev server of Vite has some trouble finding index.html after running pnpm serve. Below is my simplified configuration, which can reproduce the issue:
Actually, what I hope here is that the dev server of Vite can also find the index.html content returned from the virtual module. I have tried Vite's middleware, but it doesn't solve this problem.
Suggested solution
I think the process of searching for index.html can also be compatible with looking for it from virtual modules, rather than just searching directly from the file system.
Description
First, let me introduce the use case scenario. Vite is already powerful enough, but for our company's development, many project configurations are quite similar. I don't want to make the same basic configurations for every project, as that would make maintenance and updates extremely difficult later on. So I had a bold idea: I want to encapsulate most of the agreed-upon Vite configurations (including index.html) through a library project, so that new projects only need to reference this library and can quickly start and develop with minimal or even no configuration.
Everything went very smoothly, except for one point that got stuck, which is the handling of index.html. In fact, the build process is fine; it's just that the dev server of Vite has some trouble finding index.html after running
pnpm serve
. Below is my simplified configuration, which can reproduce the issue:Actually, what I hope here is that the dev server of Vite can also find the index.html content returned from the virtual module. I have tried Vite's middleware, but it doesn't solve this problem.
Suggested solution
I think the process of searching for index.html can also be compatible with looking for it from virtual modules, rather than just searching directly from the file system.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: