Parser-backed CSS asset URL rewriting for production builds.
Uses Vize/LightningCSS to collect parser-backed URL ranges, then patches the original source without round-tripping through the serialized CSS AST.
Summary
Functions
Rewrite relative CSS asset URLs to hashed output URLs.
Rewrite relative CSS asset URLs to dev-server URLs without copying files.
Rewrite relative CSS asset URLs and return emitted asset filenames.
Types
Functions
@spec rewrite(String.t(), String.t() | nil, String.t(), keyword()) :: rewrite_result()
Rewrite relative CSS asset URLs to hashed output URLs.
@spec rewrite_dev(String.t(), String.t() | nil, String.t(), String.t()) :: rewrite_result()
Rewrite relative CSS asset URLs to dev-server URLs without copying files.
@spec rewrite_with_assets(String.t(), String.t() | nil, String.t(), keyword()) :: rewrite_assets_result()
Rewrite relative CSS asset URLs and return emitted asset filenames.