fwouts / viteshot

Viteshot 📸 is a fast and simple component screenshot tool based on Vite.
https://viteshot.com
MIT License
214 stars 12 forks source link

Skip screenshot -- per component config? #81

Closed jgodi closed 1 year ago

jgodi commented 1 year ago

Hello, I just stumbled across this project and it is great! Thank you.

I was wondering if there could be a way to skip screenshots for components, sort of along the lines of the async screenshots. With some sort of config, like:

export const MyComponent = () => {...};
MyComponent.viteshot = { skip: true };

I know I could get fancy with the filePathPattern but I could have some things that I would like skipped all over the place and that could get messy.

fwouts commented 1 year ago

Hey @jgodi, sorry for the delay (was on holidays then got covid 😷).

I'm curious what's your filePathPattern in this case? Is it that you're using Storybook stories as the source of your ViteShot screenshots, and some of them aren't screenshot-friendly so you want to disable them?

jgodi commented 1 year ago

We have since re-architected our docs. These can likely be closed out.

Basically we had all of our examples that we wanted to take screenshots for as *.snippet.tsx. But there were some that had that name that we showed in our docs, that we didn't want screenshots taken. So that is where this skip came in.

Now, we have different *.example.tsx and .snippet.tsx to differentiate the two.

jgodi commented 1 year ago

https://github.com/fwouts/viteshot/pull/82 could be closed out too, if you want