A utility library (v0.0.14) that builds a transitive dependency tree from Rollup's OutputChunk array, enabling preloading of JavaScript imports. Designed for Sapper/SvelteKit ecosystems but usable with any Rollup build. Differentiates from general dependency analyzers by working directly with Rollup's output format. Infrequent releases; appears stable within narrow scope. Ships TypeScript types.
npm install rollup-dependency-treeVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to generate a dependency tree from a Rollup build output using the main export.
Ensure you pass output.output (the array of chunks) from bundle.generate/write.
Use a separate analyzer for dynamic imports or modify the library.
Configure Rollup's `inlineDynamicImports` or external to filter nodes.
For SvelteKit, use built-in preloading instead.
Use import statement or dynamic import().
Pass output.output (the array of OutputChunk).
Only static JS imports are captured; other types are ignored.
No dependency data recorded yet.