0.0.2 • Published 8 years ago

webpack-deps v0.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

Webpack Deps

Small utility to get the list of files that depend on other files in a webpack environment.

Install

npm install -g webpack-deps

Get Webpack Stats

In order to use this utility you will first need a webpack stats json file. This can be created from the command line with:

webpack --profile --json > webpack-stats.json

Running from the CLI

From the command line webpack-deps will take the webpack stats json file as the first argument (defaults to webpack-stats.json), and will take a list of files either following the --files arg, or piped in via stdin.

Examples:

webpack-deps stats.json -f components/Home.js components/App.js
echo 'components/Home.js components/App.js' | webpack-deps stats.json

Arguments

argdescription
first unflagged argwebpack-stats.json file
--from, -f, or piped in liststarting file list
--dependencies, -dshow dependency files
--dependents, -Dshow dependent files
--count or -coption to just show count for immediate dependencies / dependents
--levels or -loption to only go so many levels in the tree
--tree or -toutput ascii tree

Usage with Git

The ability to pipe in a list of files can be useful in particular when dealing with git. For example, you can see the files that depend on all the changed files between two different git commits:

git diff master --name-only | webpack-deps stats.json

License

ISC

0.0.2

8 years ago

0.0.1

8 years ago