This is a very experimental script setup, feel free to modify, do what you wish, you'll need to take these instructions with a pinch of salt. Its designed to allow you to annotate css/scss/less etc files and then using postcss will generate
*.critical.css
files which can then be inlined using server side includes.
- Skim through the code, updating all the paths/folder structures etc to your requirements.
- Add the extra dependencies to your node setup
- run
node split-critical.js
- or add a script alias in your package.json fornpm run criticalcss
for example. - This will generate a minified
globals.critical.css
for you to use via SSIs and any other tagged files