dependency-tree 11.1.0 → 11.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/index.js +1 -0
- package/lib/config.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,6 +50,7 @@ const list = dependencyTree.toList({
|
|
|
50
50
|
* `requireConfig`: path to a requirejs config for AMD modules (allows for the result of aliased module paths)
|
|
51
51
|
* `webpackConfig`: path to a webpack config for aliased modules
|
|
52
52
|
* `tsConfig`: path to a typescript config (or a preloaded object representing the typescript config)
|
|
53
|
+
* `tsConfigPath`: a (virtual) path to typescript config file when `tsConfig` option is given as an object, not a string. Needed to calculate [Path Mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping). If not given when `tsConfig` is an object, **Path Mapping** is ignored. This is not needed when `tsConfig` is given as a path string.
|
|
53
54
|
* `nodeModulesConfig`: config for resolving entry file for node_modules
|
|
54
55
|
* `visited`: object used for avoiding redundant subtree generations via memoization.
|
|
55
56
|
* `nonExistent`: array used for storing the list of partial paths that do not exist
|
package/index.js
CHANGED
|
@@ -106,6 +106,7 @@ module.exports._getDependencies = function(config = {}) {
|
|
|
106
106
|
webpackConfig: config.webpackConfig,
|
|
107
107
|
nodeModulesConfig: config.nodeModulesConfig,
|
|
108
108
|
tsConfig: config.tsConfig,
|
|
109
|
+
tsConfigPath: config.tsConfigPath,
|
|
109
110
|
noTypeDefinitions: config.noTypeDefinitions
|
|
110
111
|
});
|
|
111
112
|
|
package/lib/config.js
CHANGED
|
@@ -18,8 +18,8 @@ module.exports = class Config {
|
|
|
18
18
|
this.nodeModulesConfig = options.nodeModulesConfig;
|
|
19
19
|
this.detectiveConfig = options.detective || options.detectiveConfig || {};
|
|
20
20
|
this.tsConfig = options.tsConfig;
|
|
21
|
+
this.tsConfigPath = options.tsConfigPath;
|
|
21
22
|
this.noTypeDefinitions = options.noTypeDefinitions;
|
|
22
|
-
|
|
23
23
|
this.filter = options.filter;
|
|
24
24
|
|
|
25
25
|
if (!this.filename) throw new Error('filename not given');
|
|
@@ -31,6 +31,7 @@ module.exports = class Config {
|
|
|
31
31
|
const ts = require('typescript');
|
|
32
32
|
const tsParsedConfig = ts.readJsonConfigFile(this.tsConfig, ts.sys.readFile);
|
|
33
33
|
const obj = ts.parseJsonSourceFileConfigFileContent(tsParsedConfig, ts.sys, path.dirname(this.tsConfig));
|
|
34
|
+
this.tsConfigPath ||= this.tsConfig;
|
|
34
35
|
this.tsConfig = obj.raw;
|
|
35
36
|
}
|
|
36
37
|
|