Would it be possible to do what some other libraries do (namely, react-tippy) and export a css file rather than injecting a script tag? This way next can handle the styles, minify and bundle them with the other styles.
For backwards compatibility, you could have a prop called injectStyles and have it default to true. If you'd like
Edit: After revisiting, I see that the reason this is probably done is because color and height are injected into the css from the params passed by the user. I'm not against this, but I think that the style tag should atleast be minified.
Would it be possible to do what some other libraries do (namely, react-tippy) and export a css file rather than injecting a script tag? This way next can handle the styles, minify and bundle them with the other styles.
For backwards compatibility, you could have a prop called
injectStyles
and have it default to true. If you'd likeLmk what you think :)
Reference (react-tippy): First, you need import css
Edit: After revisiting, I see that the reason this is probably done is because color and height are injected into the css from the params passed by the user. I'm not against this, but I think that the style tag should atleast be minified.
https://github.com/apal21/nextjs-progressbar/blob/a122fd2303b26121f6c6a54fd1e45ad7f473ad1b/src/index.tsx#L109