This converts the run.sh script to Ruby (renaming it to run.rb in the process) and adds support for multiple input URLs and additional CSS files which should be included regardless of whether they're needed or not. The latter feature is useful for handling parts of the page which are activated by JS and don't happen to show up during the normal penthouse run.
In the process of doing that, we added postprocessing of the critical CSS with postcss and prettier. postcss reduces the duplication across CSS, which is important when we have more than one input URL. We basically generate duplicate critical CSS for both URLs, then allow postcss to remove the duplication. prettier re-styles the output from postcss, because the optimizer config we're using would otherwise make the CSS one long string.
This converts the
run.sh
script to Ruby (renaming it torun.rb
in the process) and adds support for multiple input URLs and additional CSS files which should be included regardless of whether they're needed or not. The latter feature is useful for handling parts of the page which are activated by JS and don't happen to show up during the normal penthouse run.In the process of doing that, we added postprocessing of the critical CSS with
postcss
andprettier
.postcss
reduces the duplication across CSS, which is important when we have more than one input URL. We basically generate duplicate critical CSS for both URLs, then allowpostcss
to remove the duplication.prettier
re-styles the output frompostcss
, because the optimizer config we're using would otherwise make the CSS one long string.