TailwindsCSS 2 and Meteor 2.0

Does anyone have a Tailwinds CSS 2.0 setup that works with Meteor 2.0? I tried the following Using Tailwindcss on Meteor projects - DEV Community but it seems to be based on what is now an outdated Meteor module for PostCSS. Tailwinds wants v8, hexsprite:postcss brings in PostCSS v7, I also tried the Tailwind 2.0 compat version found here: Installation - Tailwind CSS but it still throws:

While minifying app stylesheet:
   app/client/main.css: Cannot read property 'toString' of undefined

   While minifying app stylesheet:
   app/client/main.css: Cannot read property 'toString' of undefined

Anyone have a working example or know what I’m doing wrong? Is the answer just trying to look at updating the PostCSS module or swapping to a different CSS framework?

1 Like

I have managed to figure out what was wrong with the compatibility module, it wasn’t liking how I had laid out some stuff in the config file but it wasn’t overly clear about it from the error. But does anyone know if someone plans to pickup the PostCSS module to update it to v8?

A good example of how to set everything up can be found in the Packosphere repository if you still need it.

As far as picking up maintenance of the postcss package, there is an open issue for it being moved to the Meteor-Community-Packages org so that it can be kept up to date by the community. Currently, it works well with Tailwindcss with the minor issue of displaying dependency warnings in the console when you use the most recent versions of postcss and postcss-load-config but these don’t actually affect the build.

4 Likes

When I tried it with the latest versions of all the packages it was throwing errors for me causing the CSS to not compile at all. I ended up reverting to slightly older versions and using the v7 compat build of Tailwinds 2.

I had trouble when I first upgraded to the latest versions as well. I don’t remember the issue completely but there was some incompatibility when configuring autoprefixer through .postcssrc.js.

I moved the configuration to the package.json file and everthing is working as expected, including purgecss.

2 Likes

I completely misunderstood your prior comment. After copying the setup being used in Packosphere it seems to be working without any issues or warnings.

Thanks.

2 Likes