Menu

1 / 3

Which component rendered this div? A build plugin that answers in one click

DEV Community: vite·Jaroslav Barov·about 6 hours ago
#Gvg8Fr9p
#devtovite#devto#dev#plugin#vite
Long article (1546 words) — no AI summary yet.
Reading 0:00
15s threshold

Add data-source="path:line" to every JSX element in development, for Vite, Next.js and Babel. Zero runtime, works in any DevTools, and great with AI coding agents.

It's your first day on a new project. You don't know the codebase at all, and your first task is to fix a button on the checkout page. You open DevTools, click the button and see this:

<button class = "MuiButtonBase-root MuiButton-root css-1x2y3z4" >

Enter fullscreen mode

Exit fullscreen mode

Now find it in the code. You search for the class name: it's generated. You search for the text: it comes from translations. You search for the component name: it's used in 140 places. You follow imports from the router to the page, from the page to a layout, from the layout to a feature folder. Tens of minutes later, sometimes hours, you finally find the line you need.

I did exactly this for years, on every new project.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.