Standalone service to generate critical CSS, built on critical.
Run on your local machine:
git clone [email protected]:pinchofyum/tinybit-critical-css-server.git
cd tinybit-critical-css-server
npm install
npm start
Run as a Google Cloud Function:
- Create a new Cloud Run Service.
- Select "Continuously deploy new revisions from a source repository".
- Fork this repository, then select it as the repository to build.
- Build type will be "Dockerfile", because Puppeteer requires extra system dependencies.
- Complete the rest of the Create Service steps. Minimum reqs seem to be 1 GB memory, 2 CPU.
tinybit-critical-css-server implements a simple HTTP API.
Simply POST /
with html
and css
to receive css
in response.
Check out tinybit-critical-css-plugin for integration with WordPress.