atomiks/tippyjs-react

Bundle in the styling?

b-89 opened this issue · 4 comments

b-89 commented

Hi,

Would it be unreasonable to ask for the styling to be bundled with the react package? That way we don't need to list tippy.js as a direct dependency when we're only using it for the styling. We're fine just pulling it out as well, but then we'll lose out if there's any updates.

Thanks,
Brian

Hi there, I can see this is an issue using Yarn Berry and up.

In Yarn Classic, I can see the .css file is present in node_modules. In Yarn Berry and up, when unplugged, the css file does not exist.

Thanks.

EDIT: It appears as it's not exported as part of Rollup here:
https://github.com/atomiks/tippyjs-react/blob/master/rollup.config.js

b-89 commented

Hi @Kazumz, we're using pnpm. Sorry, I should have mentioned that.

Yeah, reason we're asking is due to tippy.js being a dependency of this project, would it be practical for the styles to be available inside this package so that we don't need to directly include tippy.js in our dependencies?

Therefore, an update to the rollup.config.js could be made to include the styles as well. I don't mind making a PR for it, but I wanted to check if it made sense.

I probably should have asked in the Discussions tab.

@b-89 What you're suggesting makes total sense to me!

We've had to include tippy.js as a direct dependency too, along with this react project - seems a bit of a waste not to isolate the two or at least reference the CSS from the rollup file here.

b-89 commented

Awesome! Well, now that it's apparent it would be useful for at least two projects, I'll submit a PR soon on addressing this.