Generate your Tailwind utilities as elm-css functions

I’m actually new to Parcel, and added it because the same postcss-elm-css-tailwind project compiled to 48KB with Parcel but 480KB without. The 480KB is from using the predefined npm run build:elm script, which does have optimize set.

I’ve since dropped Parcel and restarted the project, and it’s indeed a much easier workflow. But I see you’re making changes on Github for a future release to work better with webpack and parcel.

What are people additionally running to reduce the size of their compiled js file without Parcel, etc? I’m surprised that a simple minimize step can reduce the code size an additional 90%. I guess it would be a smooth workflow to have it as a build action on Netlify (or Github).

Whenever I want to spin up a new project, I use create-elm-app which has the dev an prod workflows figured out. Since with that, you don’t really get to modify the build unless you “eject” (which is something I try to avoid) I just hook up postcss-elm-css-tailwind as a standalone npm script to run before any dev or build step.

That being said, I totally see the need to integrate it with bundlers. I do have a complete PR out there that has some of the configuration asked for earlier, as well as a way to work with bundlers. I only tested with Parcel because I HATE figuring out a fresh webpack.config :slight_smile: @Philipp_Krueger was going to check out webpack on his spare time.

If you would like, I am fine merging in the configuration PR and fixing Webpack later if somehow my changes work for Parcel but not Webpack. Let me know and I’ll push the merge button!

Yeah. Hit merge!

I played briefly with elm-batteries, which uses Parcel, which would be my preferred starter kit for how it integrates with Cyprus for testing. It’s also Tailwind by default.

Published! 0.5.0 is out there which as the configuration options. Take a look at the README section for working with bundlers

Let me know if you hit any issue and I’ll see what I can do!

Published 0.6.0. I upgraded to support the latest 1.6.x of Tailwind, and also added support for all core plugins. You no longer have to turn off any features out of the box to get a valid Elm compile of your utilities!

Feel free to reach out to me here or on Slack if you have any issues.

3 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.