astroturfcss / astroturf

Better Styling through Compiling: CSS-in-JS for those that want it all.
https://astroturfcss.github.io/astroturf/
MIT License
2.28k stars 60 forks source link

Files are saved to the disk when using Parcel #610

Open buzinas opened 4 years ago

buzinas commented 4 years ago

First, thanks for creating astroturf, it has almost everything I'd like in a CSS-in-JS library!

I'm trying to use it with Parcel, but lots of files are being generated (saved to disk):

image

This is a bummer, since I don't want to have my source files polluted like that.

I tried to tweak .babelrc to use writeFiles: false, but then I get the following error:

image

For what is worth it, I'm using Parcel v2.

Is there an easy way to fix this behavior?

jquense commented 4 years ago

hi there, yes the files are written to disk when using parcel, or any other thing besides webpack. The reason boils down webpack is pluggable in a way that allows for keeping the files in memory and still processing them as if they were on disk. AFAIK that isn't possible in Parcel, or at least I don't know how to write a plugin that allows it and integrates nicely.

The other possible issue with Parcel is it uses very outdated tooling for processing css modules so some astroturf features aren't possible like selector interpolation. cc @devongovett Who can correct me if i'm super off-base!

buzinas commented 4 years ago

Would it be possible to at least remove those files after the build is done? I don't mind creating those extra files temporarily, the problem is having to remove them after I'm done.

jquense commented 4 years ago

some sort of Parcel plugin might be able to. Babel plugin tho has no idea when the build is done or even that it's being used inside of parcel and so can't guess when it'd be safe to remove them. Super open to making this better, but since i'm not personally a user of Parcel i don't have a lot of expertise or time to build it!