CSS assets not exported to the static directory when aggregation is on

Created on 7 August 2023, 11 months ago
Updated 1 September 2023, 10 months ago

Problem/Motivation

On my local, (and on the Netlify build) the local fonts declared in the CSS are not copied to the static directory when the static site is exported.
The problem seems to be the aggregated CSS path doesn't get processed in the function exportPaths() during the condition if($this->copyPath($sanitized_path, $destination))since the aggregated CSS has not been generated yet in the filesystem, when running "cold" (like after a Cache Clear).

Steps to reproduce

- local or in-build Drupal 10.1 with Tome 1.11
- A custom CSS declaring a @font-face rule with a relative path to the font
- run drush cr; drush tome:static

If I don't clear the cache and run the command (after removing the output directory), the assets are exported correctly.

Another issue that emerges is that when i perform a second run for drush tome:static, all the other assets are not processed again.

This issue may seems a duplicate of #3331190: Aggregated CSS with relative URLs breaks. β†’ but it is not related since the paths within the CSS are generated correctly, only the assets are not brought over. Furthermore the proposed patch doesn't work for in this instance.

Proposed resolution

I still need to figure it out. Ideally the CSS should be generated before getting the assets, like a sort of warmer.
This works only after a second export run, if the output folder has been removed (otherwise assets won't be regenerated).

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.11

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia elgandoz Canberra

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

Comments & Activities

Production build 0.69.0 2024