Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ var list = dependencyTree.toList({
* `filter`: a function used to determine if a module (and its subtree) should be included in the dependency tree
- The function should accept an absolute filepath and return a boolean
- If the filter returns true, the module is included in the resulting tree

* `detective`: object with configuration specific to detectives used to find dependencies of a file
- for example `detective.amd.skipLazyLoaded: true` tells the AMD detective to omit inner requires

The object form is a mapping of the dependency tree to the filesystem –
where every key is an absolute filepath and the value is another object/subtree.
Expand Down
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function Config(options) {
this.isListForm = options.isListForm;
this.requireConfig = options.config || options.requireConfig;
this.webpackConfig = options.webpackConfig;
this.detectiveConfig = options.detective || {};

this.filter = options.filter;

Expand Down Expand Up @@ -106,11 +107,11 @@ module.exports.toList = function(options) {
*/
module.exports._getDependencies = function(config) {
var dependencies;
var precintOptions = config.detectiveConfig;
precintOptions.includeCore = false;

try {
dependencies = precinct.paperwork(config.filename, {
includeCore: false
});
dependencies = precinct.paperwork(config.filename, precintOptions);

debug('extracted ' + dependencies.length + ' dependencies: ', dependencies);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"commander": "~2.6.0",
"debug": "~2.2.0",
"filing-cabinet": "^1.5.0",
"precinct": "^3.1.1"
"precinct": "^3.2.0"
},
"devDependencies": {
"babel": "~5.8.38",
Expand Down