webpack-dependency-stats

0.0.3 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i webpack-dependency-stats

Weekly Downloads

6

Version

0.0.3

License

MIT

Last publish

Collaborators

  • jantimon