bugfix: enables CSS minification via environment variable #172
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.
Setting
CLAYCLI_COMPILE_MINIFED
(or any of the variants) did notminify CSS or Fonts. This was due to our use of a package called
gulp-if
, which has a usage like this:Where
condition
is expected to either be:boolean
.function
that will return aboolean
.When setting
CLAYCLI_COMPILE_MINIFIED
from an environment variable weend up with a
string
value forminify
, which causesgulpIf
toevaluate to
false
, skipping minification.This commit simply casts
minify
to abool
when callinggulpIf
.A more robust approach would be to fix typing across the board for
environment variable defaults, providing some sort of
strToBool
method to cast
['1', 't', 'true', 'y', 'yes']
totrue
andeverything else to
false
.Taking the more robust approach would require a larger refactor and is
a good follow-up candidate for this bug fix.
change, all tests were performed manually by running
clay compile
onan existing
clay
project withexport CLAYCLI_COMPILE_MINIFIED=true
before the commit & then checking the format of the CSS output files
(they were not minified).
After adding the commit, re-running with
CLAYCLI_COMPILE_MINIFIED=true
resulted in minified CSS output.