Hacker News new | ask | show | jobs
by adriansky 2504 days ago
This is awesome! I started using Tailwind for a project. I was a concern with the relatively big size of the framework on a landing page[1]. Then I used purgeCss to only leave the css classes that I used and remove all others. That solved the size issue.

[1] https://uxeranalytics.com/

1 comments

Is there any purgecss equivalent, that is a local tool and is not node.js? I've recently searched for that and only found a defunct Ruby gem. Does the Golang world have nothing like that?
shameless plug: https://github.com/leeoniya/dropcss

it's still written in JS but there is nothing node-specific there. it easily runs in a browser, or any js environment.

Thanks a lot! It looks good.
Why not nodejs? Just curious
Because it's yet another full ecosystem with lots of dependencies where I have zero knowledge and experience.

For example, all those packages say "npm install packagename" to install, but it didn't work for me. It seems I have to (sometimes?) do a "npm init" first. No install instructions ever tell you that.

I'm sure when you're in the ecosystem, that's a given. For me it's hurdle after hurdle.

That's why I named Go and Ruby as examples. The former because you usually get a standalone executable, the latter because I already have that toolchain installed, and I know how to navigate it.

Unfortunately, everything in webdev is now node.js. Just look at any CSS framework docs (including Tailwinds, which I really like): it's an endless stream of pre-processors and post-processors, multiplied with all kinds of ES versions, Babel, yarn-or-npm, this build tool or that. It just doesn't end.

Rant over. :-)

I've been using NodeJS for about 5 years and have never seen the init usage you're talking about. `npm init` initialises your new project. At least I think that's the case, because I've never run that command. I just create a package.json file myself. Also, I use yarn instead of npm. But of course, because change, there is now a new way to use init that you just alerted me to. It sure seems like an unnecessary complication. I recommend using yarn, by the way.
I read the first part of your comment and thought "okay, I expected that I probably misunderstood the init thing".

Nothing to feel bad about, as I said, I'm an outsider, but still annoying to get it wrong in my comment.

And then I read the second part and am simply astonished. I wasn't wrong? I just happened to stumble upon a quirk that changed recently? That's something.

I think the trick to using the NodeJS/webdev ecosystem is to ignore most of what goes on and to keep one ear barely listening in case something truly useful comes along.

...and update packages with caution. SemVer doesn't always save you and neither will static analysis (because there really isn't any).