fwouts / viteshot

Viteshot 📸 is a fast and simple component screenshot tool based on Vite.

Home Page:https://viteshot.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Programmatic use?

altano opened this issue · comments

commented

Can I only take screenshots of components I actually create, or is there a way to have programmatic usage of viteshot?

I'd like to try using viteshot to generate screenshots of all my site's entrypoints programmatically. I'll ultimately use these as Open Graph / Twitter cards. Manually creating a MyEntryPointCard.screenshot.jsx component side-by-side with each MyEntrypoint.jsx is feasible but I'd rather not.

Thanks for creating this cool library.

Hey @altano, have you considered directly using https://playwright.dev for this?

commented

Yeah I'm working on that approach now. If you are interested in covering that use case with Viteshot I can help craft whatever minimal API gets us there.

For now I'll assume you're focused on the current use case (testing and ad-hoc usage by declaring components) and just close out the issue.

Thanks for making this cool library!