Giter Club home page Giter Club logo

graph's Introduction

webpack-graph

It visualize your dependency tree as svg image.

Provide it with webpack stats (as JSON) for version > 0.7.

You can generate them by calling webpack with --json.

Command Line

webpack-graph [<stats.json> [<output.svg>]]

If you don't provide the files as parameters webpack-graph will read them from stdin or write it to stdout.

--context <path> - Shorten filenames according to this context

--width <number> - The max width of the output svg

--height <number> - The max height of the output svg

--steps <number> - Limit the simulation steps

--interactive - Emit simulation code to browser

--color-by-loaders - Choose colors by loaders

--color-by-module - Choose colors by loaders

--color-switch - Chosse colors by hovering

Resulting Image

  • Circles are modules/contexts
  • The size visualize the file size.
  • The color visualize the chunks in which the module is emitted.
  • Connections are dependencies
  • webpack-graph try to guess libaries and connect them with thin lines
  • Dashed lines visualize async requires.
  • Hover modules/contexts to display more info
  • Tooltip display module name and loaders
  • Tooltip display chunks
  • Green lines display requires from other modules/contexts
  • Red lines display requires to other modules/contexts
  • Brown lines display requires to and from other modules/contexts
  • In interactive mode
  • You can drag modules/contexts with your mouse
  • Layouting happens live
  • Only tested on latest Chrome and Firefox
  • Older browsers are not supported

Example

webpack-graph

Interactive version

See more examples in webpack examples

graph's People

Contributors

sokra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

graph's Issues

cannot run

i install with sudo npm install webpack-graph -g . after that try to run with json generated with webpack. i get below error
webpack-graph input.json output.svg
env: node\r: No such file or directory

Cannot set property 'pos' of undefined

It seems like the webpack-graph is not compatible with webpack < 0.9.x anymore. When using with webpack 0.10.0-beta7 webpack-graph reports:

TypeError: Cannot set property 'pos' of undefined

in webpack-graph/lib/Graph.js:107:15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.