Rewrites new URL("./asset.ext", import.meta.url) references to asset imports.
Vite treats relative asset URL constructors as part of the module graph so
production builds can copy, hash, and rewrite the referenced file. Volt does
the same by converting the asset argument into a generated ?url import before
the normal import rewriting and bundling phases run.
Only relative specifiers that point at known static asset extensions are rewritten. Absolute URLs, package URLs, and non-asset files are left unchanged.
Summary
Functions
Rewrites matching asset URL constructors in source.