You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 21, 2023. It is now read-only.
Currently, the css_rewrite build step only honors font faces that reference font files. It also puts all font files in the same directory which may cause collisions if multiple versions of the same font are being used (you never know) in separate directories, e.g. v1, v2, v3, etc.
My proposal would be to simply search all url(*) variants and rewrite paths if it references a relative file, providing the following conditions are met:
The path does not contain a protocol;
The path does not start with a /;
The path is not an embedded image (base64).
These conditions can easily be matched using a simple regex pattern.
Once a match is found, calculate the target directory based on the output path and create directories if necessary. Then rewrite the target path in the CSS.
I think this is how other CSS-rewrite modules do it too.