MrBin99 / django-vite

Integration of ViteJS in a Django project.
Apache License 2.0
570 stars 72 forks source link

VitePress compatibility? #133

Open sqmch opened 6 months ago

sqmch commented 6 months ago

Hello,

Can django-vite be used with VitePress? The output static files when deployed are a bit different, there is no js file to point to as the main asset to get injected into the template and the hashmap.json, which is a manifest.json equivalent of sorts, is differently structured. In some sense it all seems to have to be possible, but does anyone have experience or ideas on if and how it can be pulled off?

Thank you

MrBin99 commented 6 months ago

Hi, I don't understand why you need to combine VitePress which is a static site generator to a Django project ?

If your datas of your static site is in Django, I think you mean you use Django as a "headless CMS" and I think you don't need to combine the two projects.

One is your backend (Django) that provide APIs and the other your frontend and you can host them pretty much in different places or strategies.

So you do not have to combine the two.

sqmch commented 6 months ago

Hey, thanks for the reply.

The reason is I want to combine the two is due to an existing project being already built in django. Parts of it have been built or rebuilt using django-vite to inject vue into a django template. Recently the idea of adding docs built with VitePress has arisen and I'm exploring the idea of not having to host the static files separately but rather include them in the existing way of doing things, however I am getting the sense that it's not really doable with django-vite, but figured my understanding of how to use it could be limited and thus the question.

MrBin99 commented 6 months ago

I understand.

For now, I think django-vite do not support VitePress and I think will not in the near future as the need to combine VitePress and Django is not very common I think, maybe I'm wrong.

You may write your own parser for the VitePress manifest or as I said maybe completely separate the two projects.

Feel free to submit a PR if you think your parser needs to be part of VitePress.

Thank you for your message !