mirror of
https://github.com/morluto/rea.git
synced 2026-10-30 11:25:39 +00:00
* fix(javascript): resolve Vite build-output preload dependencies With an absolute base, Vite writes __vite__mapDeps entries relative to the build output directory (for example assets/chunk.js), and its preload helper prefixes the configured base at runtime. REA emitted these entries as dynamic-import module specifiers, so a scheme-less path without a leading dot resolved as a bare package and every entry was reported as an unresolved "external" module, even when the build output directory was selected. The static analyzer now marks such entries with a vite-output: specifier, as Webpack chunk loads are marked with chunk:. Entries starting with ./, ../ or /, and scheme-qualified entries, keep their previous handling. The graph resolves a marked entry as a URL path under each ancestor directory of the importing file; exactly one ancestor holding the file establishes the build output directory. Otherwise the entry is not-found (or unavailable when several ancestors match) with a limitation that names the build output directory. On a synthetic 7-file Vite build, the 12 preload entries that were "external" now resolve when the build output directory is selected, and are not-found with that guidance when only assets/ is selected. * fix(javascript): keep unanalyzed Vite output candidates resolveViteOutputDependency considered only resolved ancestors. A file that exists under an ancestor but was not analyzed (for example dist/assets/lazy.css for the entry assets/lazy.css) resolves there as unavailable, and that result was replaced by the root's not-found with a limitation saying that no ancestor holds the file. Keep resolved and unavailable ancestor candidates together. One candidate is returned with its own path and limitations; several are reported as unavailable with every candidate path and limitation. Only when no ancestor can hold the file does the root's not-found result stand.