1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.getModulePath = void 0;
|
4 | var fs_1 = require("fs");
|
5 | var path_1 = require("path");
|
6 | var JSCONFIG = 'jsconfig.json';
|
7 | var TSCONFIG = 'tsconfig.json';
|
8 | var getModulePath = function (appDirectory) {
|
9 |
|
10 | var configName = '';
|
11 | if (fs_1.existsSync(path_1.join(appDirectory, TSCONFIG))) {
|
12 | configName = TSCONFIG;
|
13 | }
|
14 | else if (fs_1.existsSync(path_1.join(appDirectory, JSCONFIG))) {
|
15 | configName = JSCONFIG;
|
16 | }
|
17 | try {
|
18 |
|
19 | var baseUrl = require(path_1.join(appDirectory, configName)).compilerOptions.baseUrl;
|
20 | return (baseUrl ? [baseUrl] : []);
|
21 | }
|
22 | catch (e) {
|
23 | return [];
|
24 | }
|
25 | };
|
26 | exports.getModulePath = getModulePath;
|
27 |
|
\ | No newline at end of file |