dependency-tree
Advanced tools
Comparing version 5.6.1 to 5.7.0
@@ -15,2 +15,3 @@ var precinct = require('precinct'); | ||
this.webpackConfig = options.webpackConfig; | ||
this.detectiveConfig = options.detective || {}; | ||
@@ -110,7 +111,7 @@ this.filter = options.filter; | ||
var dependencies; | ||
var precinctOptions = config.detectiveConfig; | ||
precinctOptions.includeCore = false; | ||
try { | ||
dependencies = precinct.paperwork(config.filename, { | ||
includeCore: false | ||
}); | ||
dependencies = precinct.paperwork(config.filename, precinctOptions); | ||
@@ -117,0 +118,0 @@ debug('extracted ' + dependencies.length + ' dependencies: ', dependencies); |
{ | ||
"name": "dependency-tree", | ||
"version": "5.6.1", | ||
"version": "5.7.0", | ||
"description": "Get the dependency tree of a module", | ||
@@ -36,3 +36,3 @@ "main": "index.js", | ||
"filing-cabinet": "^1.5.0", | ||
"precinct": "^3.1.1" | ||
"precinct": "^3.2.0" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
@@ -5,3 +5,3 @@ ### dependency-tree [![npm](http://img.shields.io/npm/v/dependency-tree.svg)](https://npmjs.org/package/dependency-tree) [![npm](http://img.shields.io/npm/dm/dependency-tree.svg)](https://npmjs.org/package/dependency-tree) | ||
`npm install dependency-tree` | ||
`npm install --save dependency-tree` | ||
@@ -47,4 +47,6 @@ ### Usage | ||
- 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 | ||
- See [precinct's usage docs](https://github.com/dependents/node-precinct#usage) for the list of module types you can pass options to. | ||
The object form is a mapping of the dependency tree to the filesystem – | ||
@@ -51,0 +53,0 @@ where every key is an absolute filepath and the value is another object/subtree. |
@@ -5,3 +5,3 @@ import assert from 'assert'; | ||
import path from 'path'; | ||
import precinct from 'precinct'; | ||
import rewire from 'rewire'; | ||
@@ -208,2 +208,24 @@ const dependencyTree = rewire('../'); | ||
describe('when given a detective configuration', function() { | ||
it('passes it through to precinct', function() { | ||
const spy = sinon.spy(precinct, 'paperwork'); | ||
const directory = __dirname + '/example/onlyRealDeps'; | ||
const filename = directory + '/a.js'; | ||
const detectiveConfig = { | ||
amd: { | ||
skipLazyLoaded: true | ||
} | ||
}; | ||
dependencyTree({ | ||
filename, | ||
directory, | ||
detective: detectiveConfig | ||
}); | ||
assert.ok(spy.calledWith(filename, detectiveConfig)); | ||
spy.restore(); | ||
}); | ||
}); | ||
describe('when given a list to store non existent partials', function() { | ||
@@ -210,0 +232,0 @@ describe('and the file contains no valid partials', function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32119
806
82
Updatedprecinct@^3.2.0