INNER CODE UNIT · Go
path
cc1a2b/JShunter · internal/jshunter/chunkgraph.go:423
path := prefix + name + mid + hash + suffix
out = append(out, ChunkRef{ID: id, Name: name, Path: path, Source: source})
}
// Map iteration is unordered; sort so the result is reproducible.
sort.Slice(out, func(i, j int) bool { return out[i].Path < out[j].Path })
return out
}
// cgViteDeps recovers the dependency file table Vite inlines for its preloader.
func cgViteDeps(body []byte, st *Structure) []ChunkRef {
if !strings.Contains(string(body), "__vite__mapDeps") && !strings.Contains(string(body), "__vitePreload") {
return nil
}
var out []ChunkRef
for i := range st.literals {
lit := &st.literals[i]
if lit.Role != RoleArrayElem {
continue