webpack-dependency-stats
v0.0.3
Published
Extracts a flat list of all dependencies and dependents of a given webpack module
Downloads
17
Readme
Webpack Dependency Stats
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.