-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Ability to extend vite config #241
Comments
I do see an alias option in here: https://github.com/vuejs/vitepress/blob/master/src/node/config.ts which might be what I'm looking for, though I haven't been able to get it to work yet. Alias is deprecated though, so that doesn't seem to work. Yeah it looks like |
If you put a |
Yeah I discovered that, but then it'll fail to compile SFC's. I assume because it needs some additional config for that, but wouldn't I at that point be rewriting whatever VitePress has built in? |
Hmm, not sure. It works as expected in the Vue blog: https://github.com/vuejs/blog/blob/master/vite.config.js |
🤔 strange. Let me experiment with this some more. Should it just merge the configs though? |
@TheDutchCoder Do you have any updates on this? 👀 If not, maybe we could close this one for now and open another issue if you encounter the issue again. |
Maybe due to this vitejs/vite#2847 |
Oh OK cool. Let's see how it goes with that issue then. |
@antfu OK seems like Vite PR is merged. Is it already released? If so, all we need to do is upgrade Vite version right 👀 ? |
The PR has been merged, but it is not yet released. I'll ping here when this fix is included in the next release |
@patak-js Great! Thanks 🤝 |
@kiaking vitejs/vite#2847 has been released in v2.2.0 |
Is your feature request related to a problem? Please describe.
Currently there seems to be no way to extend the Vite config used by vitepress (or at least it's not clear how to do it).
It would be great to have that ability to specify aliases that are used inside of components that are not part of VitePress.
In our case we have a component library in
src
, and the docs indocs
, but components imported in VitePress use#components/button
imports (for example) and VitePress can't resolve those as there's no way to set up aliases for it.Describe the solution you'd like
A way to extend vite config and/or specify aliases.
Describe alternatives you've considered
I tried creating a vite config in the root, but that prevents TS based SFC's from compiling properly (I think it overwrites the internal config).
Additional context
A quick screenshot of our setup:
docs/.vitepress
hosts VitePress, but the root is Vite itself (library mode).The text was updated successfully, but these errors were encountered: