mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-03 07:57:22 +00:00
Root cause of the Tailwind v4 'Missing closing } at font-face' runtime error: font assets imported via a CSS @import (e.g. @fontsource packages) were emitted as url(https://esm.sh/*@fontsource/...woff2). The /* from esm.sh's wildcard ('externalize all deps') prefix sits inside an unquoted url(), and the in-browser Tailwind v4 tokenizer misreads it as the start of a CSS comment, scanning past the rule's closing } and throwing. esm.sh's '*' only affects JS module builds; for raw static assets it is meaningless and the same file is served without it. Strip the '/*' prefix from externalized asset URLs (and ?url asset imports) so emitted CSS url() values are parseable by all CSS parsers, not just the ones tolerant of '/*' inside url(). JS module URLs are untouched. Adds unit tests for stripAssetUrlWildcard.