JakobJingleheimer / nodejs-loaders

A collection of loaders to facilitate a quick and easy local development and CI testing environment.
11 stars 3 forks source link

`css-parse` -> `css` throw deprecated warn #4

Closed AugustinMauroy closed 5 months ago

AugustinMauroy commented 7 months ago

css npm package wasn't maintained for 4 year. also I didn't found any way with ccs to parse nested css.

So one solution it's to use @adobe/css-tools other solution is lightningcss

AugustinMauroy commented 7 months ago

EDIT: there are no nested css support ref

JakobJingleheimer commented 7 months ago

Ah, okay. This feature CSS nesting selectors did not exist when this loader was created.

I would say this feature is largely superfluous and is better addressed with css-modules (for which esbuild has built-in support).

Buuut it is spec'd, so I'll look for a replacement. The underlying lib I used is indeed unmaintained but it did what it needed to do (quite well and efficiently) for quite some time (I've been using this loader for like 4 years). Lightning is rather unstable—its releases are not infrequently broken.

AugustinMauroy commented 5 months ago

I had do some experimentation with esbuild, @adobe/css-tools, Lightningcss and postcss. So here the branch. nothing has changed in terms of the spec.

But node_module size change 🎉

Note: install all dependencies in the project root directory so it's also with devDependencies

main: 15,7mo experiment: 15,1mo

So, IMHO postcss can do the job

JakobJingleheimer commented 5 months ago

W00t! I left a couple comments on that branch. It generally looks 👍 Do you wanna open a PR with it?

AugustinMauroy commented 5 months ago

Do you wanna open a PR with it?

At first it was an experiment, but if you like it, here you go #7

JakobJingleheimer commented 5 months ago

Resolved by #7