nystudio107 / craft-vite

Allows the use of the Vite.js next generation frontend tooling with Craft CMS
MIT License
52 stars 16 forks source link

Favicon support #40

Closed acalvino4 closed 2 years ago

acalvino4 commented 2 years ago

As far as I can tell, vite-plugin-favicon is the primary solution people have to integrating favicon builds into Vite.

I see that an integration of some sort is "on the roadmap" for this Craft plugin, but I don't see any issue or documentation about it, so I am curious if that is still the case, or if it perhaps is implemented and is just lacking documentation.

I see that vite-plugin-favicon has an inject option, though there is no documentation about what happens if this is false. I noticed this pull request, though it doesn't look like it was ever merged?? Either way, I'm guessing you know something about if and how this can be integrated into a Craft setup, and would be happy to be pointed in the right direction, or even have formal support for this feature to the extent it is possible.

I guess I have 3 main questions:

  1. Is there a way to get vite-plugin-favicon to output the images and html on build to someplace where I can then include them manually?
  2. Is there a way to get vite to insert the appropriate html for favicons in development via the craft.vite.script tag
  3. If no for either of the above, do you still expect this to be supported at some point? Does it depend on the vite plugin making updates?
acalvino4 commented 2 years ago

I discovered your fork of vite-plugin-favicon: https://github.com/khalwat/vite-plugin-favicon. I assume this is the solution you came up with.

Once webapp.html is generated, do you just include the file from dist/assets via craft.vite.inline, or is supposed to get included automatically via craft.vite.script? Just want to make sure my setup is working as intended.

khalwat commented 2 years ago

See here: https://github.com/nystudio107/devmode/blob/develop/cms/templates/_boilerplate/_partials/head-meta.twig#L18