Skip to content

Commit 1cb903d

Browse files
committed
1 parent 02cbb43 commit 1cb903d

File tree

7 files changed

+272
-286
lines changed

7 files changed

+272
-286
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var tree = dependencyTree({
2121
directory: 'path/to/all/files',
2222
requireConfig: 'path/to/requirejs/config', // optional
2323
webpackConfig: 'path/to/webpack/config', // optional
24+
tsConfig: 'path/to/typescript/config', // optional
2425
nodeModulesConfig: {
2526
entry: 'module'
2627
}, // optional
@@ -41,6 +42,7 @@ var list = dependencyTree.toList({
4142

4243
* `requireConfig`: path to a requirejs config for AMD modules (allows for the result of aliased module paths)
4344
* `webpackConfig`: path to a webpack config for aliased modules
45+
* `tsConfig`: path to a typescript config (or a preloaded object representing the typescript config)
4446
* `nodeModulesConfig`: config for resolving entry file for node_modules
4547
* `visited`: object used for avoiding redundant subtree generations via memoization.
4648
* `nonExistent`: array used for storing the list of partial paths that do not exist

index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const Config = require('./lib/Config');
2121
* Format is a filename -> tree as list lookup table
2222
* @param {Array} [options.nonExistent] - List of partials that do not exist
2323
* @param {Boolean} [options.isListForm=false]
24+
* @param {String|Object} [options.tsConfig] Path to a typescript config (or a preloaded one).
2425
* @return {Object}
2526
*/
2627
module.exports = function(options) {
@@ -107,7 +108,8 @@ module.exports._getDependencies = function(config) {
107108
ast: precinct.ast,
108109
config: config.requireConfig,
109110
webpackConfig: config.webpackConfig,
110-
nodeModulesConfig: config.nodeModulesConfig
111+
nodeModulesConfig: config.nodeModulesConfig,
112+
tsConfig: config.tsConfig
111113
});
112114

113115
if (!result) {

lib/Config.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Config {
1414
this.webpackConfig = options.webpackConfig;
1515
this.nodeModulesConfig = options.nodeModulesConfig;
1616
this.detectiveConfig = options.detective || options.detectiveConfig || {};
17+
this.tsConfig = options.tsConfig;
1718

1819
this.filter = options.filter;
1920

0 commit comments

Comments
 (0)