Skip to content
Extracts a flat list of all dependencies and dependents of a given webpack module
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
.node-version
.travis.yml
CHANGELOG.md
LICENSE
README.md
appveyor.yml
index.js
package.json

README.md

Webpack Dependency Stats

npm version Dependency Status Build status Build status js-semistandard-style Coverage Status

A helper to get a flat list of all dependencies and dependents of a given module

Installation

Install the plugin with npm:

$ npm install --save-dev webpack-dependency-stats

Basic Usage

You have to pass the stats from the webpack compilation: https://webpack.github.io/docs/node.js-api.html#stats

var webpackDependencyStats = new WebpackDependencyStats(stats, {
  srcFolder: path.resolve(__dirname, 'src')
});
console.log(webpackDependencyStats.getDependencies('./entry.js'));
console.log(webpackDependencyStats.getDependents('./entry.js'));

Include external dependencies

var webpackDependencyStats = new WebpackDependencyStats(stats, {
  srcFolder: path.resolve(__dirname, 'src'),
  onlyLocal: false
});
console.log(webpackDependencyStats.getDependencies('./entry.js'));
console.log(webpackDependencyStats.getDependents('./entry.js'));

Changelog

Take a look at the CHANGELOG.md.

Contribution

You're free to contribute to this project by submitting issues and/or pull requests. This project is test-driven, so keep in mind that every change and new feature should be covered by tests. This project uses the semistandard code style.

License

This project is licensed under MIT.

You can’t perform that action at this time.