Closed bengolder closed 3 years ago
I think the best approach for this is to insert the version after minification has happened.
sassc
doesn't have an option to ignore certain comments on minification, it will remove ALL comments. Hence why we want to add the comment after minificaiton.
Something like:
(pseudo code)
echo "/* Honeycrisp v$(Cfa::Styleguide::VERSION) Build time: $(date '+%m-%d-%Y %H:%M:%S')n */n$(cat scripts.min.js)" > scripts.min.js
Do this for both honeycrisp.min.css
and honeycrisp.min.js
When we generate static CSS & JS files, they should include a specific version number, so that we can better debug issues that arise and understand when static assets are out of date. This is most relevant to SHIBA and any non-ruby projects that use Honeycrisp, because they rely on the generated static assets.
This is done when running
rake assets:package
createshoneycrisp.min.css
andhoneycrisp.min.js
files that include a comment with the latest honeycrisp version number.