Last active
March 2, 2019 09:11
-
-
Save matiaskorhonen/bf403014ad25bc74a92eadeae2af1d5d to your computer and use it in GitHub Desktop.
Read paths from a file and process them with https://github.com/addyosmani/critical/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% sitemap.resources.select {|r| r.path =~ /\.html\z/i }.each do |resource| %> | |
<%= resource.destination_path %> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while IFS="" read -r html || [ -n "$html" ] | |
do | |
echo "Processing 'build/$html'" | |
cat "build/$html" | yarn run --silent critical --base build --folder $(dirname "build/$html") --inline | tee "build/$html" 1> /dev/null | |
done < build/__paths.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment