Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ondras/rollup-plugin-graph
Generates module dependencies graph, using the DOT language.
https://github.com/ondras/rollup-plugin-graph
util
Last synced: about 1 month ago
JSON representation
Generates module dependencies graph, using the DOT language.
- Host: GitHub
- URL: https://github.com/ondras/rollup-plugin-graph
- Owner: ondras
- Created: 2017-04-03T08:19:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-11-01T14:51:45.000Z (about 2 years ago)
- Last Synced: 2024-10-30T03:31:38.686Z (about 1 month ago)
- Topics: util
- Language: JavaScript
- Homepage:
- Size: 396 KB
- Stars: 31
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - graph
README
# rollup-plugin-graph
Generates module dependencies graph, using the DOT language. To actually draw images, you will need the `graphviz` toolbox.
In your `rollup.config.js`:
```js
let graph = require("rollup-plugin-graph");
let graphOptions = {prune: true};module.exports = {
/* ... */
plugins: [ graph(graphOptions) ]
};
```In your terminal:
```sh
rollup -c | dot -Tpng > graph.png
```## Options
* `prune` (bool) Whether to prune the resulting graph, leaving only cyclic dependencies. This makes the graph [strongly connected](https://en.wikipedia.org/wiki/Strongly_connected_component).
Examples: [pruned](https://raw.githubusercontent.com/ondras/sleeping-beauty/master/graphs/pruned.png), [not pruned](https://raw.githubusercontent.com/ondras/sleeping-beauty/master/graphs/complete.png)
* `exclude` (string or regexp) Specified the module ID pattern to be excluded from the graph.## Sample output
![](demo.png)
Please note that this plugin is not directly responsible for image rendering. It generates output in the [DOT language](https://en.wikipedia.org/wiki/DOT_(graph_description_language)), so you need to use a proper tool (such as [Graphviz](https://www.graphviz.org/)) to create the image.