Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 772 Bytes

README.md

File metadata and controls

29 lines (19 loc) · 772 Bytes

Script to export critical CSS

Usage

Install node modules

npm i

To run get result in console please run command below. You will see your critical CSS in console output.

node .\src\get-critical-css.js --url "{{YOUR_URL}}" --output "console"

To get result in file please run command below. You will find a minified CSS file in dist folder.

node .\src\get-critical-css.js --url "{{YOUR_URL}}" --output "file"

Websites with media break points

If your side have a responsive layout based on viewport size you can provide expected width as an array. Please note that no spaces allowed for width property.

node .\src\get-critical-css.js --url "https://my.website.com/foo" --output "file" --width [699,1199,1499]