Skip to content

Extracts a flat list of all dependencies and dependents of a given webpack module

License

Notifications You must be signed in to change notification settings

jantimon/webpack-dependency-stats

Repository files navigation

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.

About

Extracts a flat list of all dependencies and dependents of a given webpack module

Resources

License

Stars

Watchers

Forks

Packages

No packages published