Registry / serialization / rollup-dependency-tree

rollup-dependency-tree

JSON →
library0.0.14jsnpmunverified

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-tree
INSTALL
IMPORT
SIG · ROLLUP-DEPENDENCY-
R
rollup-dependency-tree
serializationjavascriptv0.0.14
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

generateDependencyTree
import { generateDependencyTree } from 'rollup-dependency-tree'
const generateDependencyTree = require('rollup-dependency-tree')
ESM-only package; named export. CJS require returns undefined.
treeify
import { treeify } from 'rollup-dependency-tree'
Named export for converting tree structure into a string representation (like tree CLI).
default
import rollupDependencyTree from 'rollup-dependency-tree'
import { default } from 'rollup-dependency-tree'
Default export is same as generateDependencyTree; named import preferred for clarity.

Demonstrates how to generate a dependency tree from a Rollup build output using the main export.

import { generateDependencyTree } from 'rollup-dependency-tree'; // Assume `output` is the result of rollup.generate() or rollup.write() import { rollup } from 'rollup'; async function main() { const bundle = await rollup({ input: 'src/main.js' }); const { output } = await bundle.generate({ format: 'es' }); const tree = generateDependencyTree(output); console.log(JSON.stringify(tree, null, 2)); } main().catch(console.error);
Debug
Known issues
gotchaInput must be Rollup OutputChunk[], not OutputAsset[] or complete bundle.
fix
Ensure you pass output.output (the array of chunks) from bundle.generate/write.
affects: >=0.0.0
gotchaOnly handles static import statements; dynamic imports (import()) are not included in the tree.
fix
Use a separate analyzer for dynamic imports or modify the library.
affects: >=0.0.0
gotchaTree may include external dependencies (node_modules) if not excluded by Rollup config.
fix
Configure Rollup's `inlineDynamicImports` or external to filter nodes.
affects: >=0.0.0
deprecatedOriginal Sapper integration is deprecated; SvelteKit uses a different mechanism.
fix
For SvelteKit, use built-in preloading instead.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: generateDependencyTree is not a function
Using CJS require on an ESM-only package.
fix
Use import statement or dynamic import().
Cannot read properties of undefined (reading 'module')
Passing entire bundle object instead of output array.
fix
Pass output.output (the array of OutputChunk).
The tree does not include all imports
Dynamic imports or non-JS imports (CSS, images) are not processed.
fix
Only static JS imports are captured; other types are ignored.
Upgrade
Version history
0.0.14latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
rollup-dependency-tree — npm install rollup-dependency-tree · libregistry