apal21 / nextjs-progressbar

A simple Next.js progressbar component using NProgress.
https://www.npmjs.com/package/nextjs-progressbar
MIT License
776 stars 61 forks source link

Question: tsup & styled-jsx #72

Closed ivan-kleshnin closed 2 years ago

ivan-kleshnin commented 2 years ago

Hello, Apal. Thank you for making this library!

Sorry for posting a question here 🙏 I'm really interested about your experience with tsup and styled-jsx. I see you've chosen to style your component with raw style and id. That's probably a good choice for this particular project.

But what what you do if you had to develop a component library for NextJS? You'd probably consider styled-jsx which is NextJS' default styling library, right?!

Unfortunately, styled-jsx is not compatible with tsup because it requires a transpilation step with babel macro/plugin. And tsup is based on esbuild which is unrelated to babel at all. That was my research, maybe you'll be kind enough to share yours 😉

It's really unclear how to develop a component library for NextJS with tsup / tsdx / vite / microbundle / etc... besides configuring Webpack/Rollup from the ground up. Every high-level tool I try is incompatible with styled-jsx expectations in one way or another.

apal21 commented 2 years ago

Hey @ivan-kleshnin,

I have never used tsup, tsdx for anything. I'll do some research and let you know here if I find something.

For now, since it is not related to this project, I'm closing the issue.