Fixes to allow for loading full tailwind build for better dev experience #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.