critical2partial (critical-tool)
Tool for create critical html partials
Install
npm i bolighed-critical2partial -D
Example
critical.config.js
const path = ; moduleexports = config = parallel_tabs: 4 browser_args: // '--disable-gpu', // `--window-size=${ resolution.x },${ resolution.y }`, '--no-sandbox' files: critical_options: base: path folder: 'assets' ignore: "@font-face" width: 1300 height: 900 minify: true static_file: 'http://localhost:18000/bolig/aarhus-c/8000/thorvaldsensgade/1/1/th/sundhed' output_file: '../../../backend/home/templates/home/critical.home.html'
critical_options are the options of the critical
npm module. static_file
could also be a url, if so it will the file will be fetched from remote.
Use from CLI
bolighed-critical2partial -c ./example.config.js
Use programmatically
index.js
const config = ;const c2p = config;