Parser-backed CSS asset URL rewriting for production builds.
Uses Vize/LightningCSS to parse CSS into an AST, rewrites URL nodes, and prints the transformed AST back to CSS.
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.