Add support for downloading critical CSS from an URL

Created on 13 June 2024, 5 months ago

Problem/Motivation

We use Vite as build tool, and while in development mode, compiled assets are not written to disk. Because of this, we can't test critical CSS while in development mode. We have to exit and do a production build before we can test it.

Proposed resolution

Add support for adding external URLs as suggested file paths in hook_critical_css_file_paths_suggestion_alter implementations. If the file is an external URL, download it. If CSS preprocessing is enabled, write it to a temporary file before processing. I tested this and it works really fast, especially because the URL it's being downloaded from is local, so there's barely any latency.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024