lukeed / clsx

A tiny (239B) utility for constructing `className` strings conditionally.
MIT License
8.08k stars 141 forks source link

Alternative install methods to npm? #91

Closed GetPsyched closed 5 months ago

GetPsyched commented 6 months ago

Hello. First off, thanks a ton for this utility!

I just started off a tiny project that won't be using NodeJS, React, or any fancy frameworks; just plain old HTML. I am easily able to embed TailwindCSS as it has an offering without NodeJS. I didn't see a similar installation method for clsx; is this possible and/or planned? Or would it be simpler to just copy paste code from here to my project?

skyrpex commented 5 months ago

May I ask why? npm/Yarn/pnpm are very well established and pretty much the defacto for installing dependencies. You'll have a hard time not using them for any package!

GetPsyched commented 5 months ago

It's because the project is too tiny for me to bother with frameworks, etc. The biggest and mostly only dependency I need is TailwindCSS which is already available to install in plain HTML.

clsx is just a nice to have which is why I asked here. Even so, it doesn't justify adding npm or nodejs to my dependencies since I won't need any packages in the future either. If I do, then I'll most likely just switch out of plain HTML as well.

skyrpex commented 5 months ago

In that case, have you tried using CDN's such as unpkg? You should be able to load clsx directly into HTML by adding

<script src="https://www.unpkg.com/clsx@2.1.0/dist/clsx.min.js"></script>

to your page.

Note: that should work for any npm package if you like that kind of work style.

GetPsyched commented 5 months ago

Oh well, that pretty much solves my problem neatly; thanks!