Fix purgeEnabled
evaluating to true when config.purge.enabled
is false
#1673
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.
Hi!
This is a quick bugfix regarding the new
config.purge
options, basically the following:Evaluate to
true
even when the purge option is explicitely disabled in the config like that:The first test evaluates to false so only the value of the
or
condition is taken into account but this one evaluate to true when in production regardless of theconfig.purge.enabled
value, this pull request fix that.To give more context over how I came across that I was annoyed by my build spamming
Skipping purge because no template paths provided...
because myconfig.purge
was undefined and fallbacking to Tailwind default config value (an empty array), so I decided to explicitly disable the purge option the way above but then my build started failing. So I dug a bit and found that. I would like to also propose to change Tailwind default purge config to the one above in order to omit the warning when no purge config is set by default, but that's open to discussion.Cheers~!