I made the changes in this PR in an attempt to be able to use any tailwind class in development without needing to re-run build:tailwind, as this takes 10-15 seconds on my machine. With these changes, you only need to wait a few seconds for tailwind to build the first time, and you should then be able to freely use tailwind classes. Unused classes are still being properly purged for production builds.
I made the following changes to support this, which I think previously may have made webpack choke or run out of memory when trying to make the build for the dev server:
removed the variants specified in the tailwind config. I think these are included by default
changed the purge rule so that it's more focused. I think it was targeting node_modules and .next.
I did a quick check and it doesn't seem to have broken any styles. I am also able to generate a working production build. If you're interested in making this change, I am happy to do a careful comparison to look for regressions and set up a staging site. If not, please let me know what I'm missing, or perhaps this will be useful to someone else.
I made the changes in this PR in an attempt to be able to use any tailwind class in development without needing to re-run
build:tailwind
, as this takes 10-15 seconds on my machine. With these changes, you only need to wait a few seconds for tailwind to build the first time, and you should then be able to freely use tailwind classes. Unused classes are still being properly purged for production builds.I made the following changes to support this, which I think previously may have made webpack choke or run out of memory when trying to make the build for the dev server:
removed the variants specified in the tailwind config. I think these are included by default
changed the purge rule so that it's more focused. I think it was targeting
node_modules
and.next
.I did a quick check and it doesn't seem to have broken any styles. I am also able to generate a working production build. If you're interested in making this change, I am happy to do a careful comparison to look for regressions and set up a staging site. If not, please let me know what I'm missing, or perhaps this will be useful to someone else.