SIGN IN SIGN UP

fix(cli): localize external assets in publish archive (#1160)

Compositions referencing assets outside the project directory (via ../
paths) produced broken published projects — those files were never
included in the ZIP archive.

localizeExternalAssets() now scans all HTML and CSS files in the archive
for src, href, and url() references that resolve outside the project
dir. For each, it copies the file into the archive under _ext/ and
rewrites the reference to point there.

Handles: src/href attributes, <style> url(), inline style url(),
standalone CSS url(), sub-composition HTML files, deduplication of
the same asset referenced from multiple files.

Shared primitives (CSS_URL_RE, isNonRelativeUrl, isPathInside) extracted
into core/compiler/assetPaths.ts — single source of truth across core,
producer, and CLI.
M
Miguel Ángel committed
a4706da513a1509d097f8179d04d995f038469b3
Parent: 598e3e9
Committed by GitHub <noreply@github.com> on 6/2/2026, 1:06:35 AM