Next.js Discord

Discord Forum

Are there parsers that parse both html and jsx on npm ?

Unanswered
Somali posted this in #help-forum
Open in Discord
SomaliOP
Hello ! I'm developing a vite plugin that makes your tailwind code easier to read. It supports Svelte and Vue, but I want to support React. I started to make the logic run outside of Vite's plugin api in order to port it to webpack too. The goal is to support react and nextjs.

I currently use the npm package node-html-parser to parse svelte and vue components, but this obviously get errors with jsx. So I'm wondering if there's a parser that can parse both jsx and html. I want to support React, but I don't want svelte and vue users to install an unnecessary parser just for react... That's why I want to look for a parser that can parse both html and jsx.

If you're interested: https://www.npmjs.com/package/vite-plugin-tailwind-attributify

Have a nice day 🙂

1 Reply

SomaliOP
bump