js-codeviz
v0.1.6
Published
Build chunk and lazy-import dependency graphs as HTML reports
Maintainers
Readme
js-codeviz
Reusable CLI and library for generating two HTML reports:
- chunk dependency graph from built JS chunks (
chunk-graph.html) - lazy import graph from source (
lazy-graph.html)
Example output

Install
npm i -D js-codevizUse in package.json
{
"scripts": {
"build:chunk-graph": "codeviz-build-chunk-graph --dist dist --out chunk-graph.html",
"build:lazy-graph": "codeviz-build-lazy-graph --project-root . --src src --out lazy-graph.html"
}
}Single CLI
npx js-codeviz chunk-graph --dist dist --out chunk-graph.html
npx js-codeviz lazy-graph --project-root . --src src --out lazy-graph.htmlProgrammatic API
import { buildChunkGraph, buildLazyGraph } from "js-codeviz"
await buildChunkGraph({
distDir: "dist",
outputPath: "chunk-graph.html",
})
await buildLazyGraph({
projectRoot: ".",
srcDir: "src",
outputPath: "lazy-graph.html",
})Notes
chunk-graphexpectsdist/index.htmlwith<script src="...">entries.lazy-graphuses TypeScript module resolution and requirestsconfig.app.jsonortsconfig.json.
