source: frontend/node_modules/tsconfig-paths/lib/config-loader.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.1 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.configLoader = exports.loadConfig = void 0;
4var TsConfigLoader2 = require("./tsconfig-loader");
5var path = require("path");
6var options_1 = require("./options");
7function loadConfig(cwd) {
8 if (cwd === void 0) { cwd = options_1.options.cwd; }
9 return configLoader({ cwd: cwd });
10}
11exports.loadConfig = loadConfig;
12function configLoader(_a) {
13 var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
14 if (explicitParams) {
15 // tslint:disable-next-line:no-shadowed-variable
16 var absoluteBaseUrl_1 = path.isAbsolute(explicitParams.baseUrl)
17 ? explicitParams.baseUrl
18 : path.join(cwd, explicitParams.baseUrl);
19 return {
20 resultType: "success",
21 configFileAbsolutePath: "",
22 baseUrl: explicitParams.baseUrl,
23 absoluteBaseUrl: absoluteBaseUrl_1,
24 paths: explicitParams.paths,
25 mainFields: explicitParams.mainFields,
26 addMatchAll: explicitParams.addMatchAll,
27 };
28 }
29 // Load tsconfig and create path matching function
30 var loadResult = tsConfigLoader({
31 cwd: cwd,
32 getEnv: function (key) { return process.env[key]; },
33 });
34 if (!loadResult.tsConfigPath) {
35 return {
36 resultType: "failed",
37 message: "Couldn't find tsconfig.json",
38 };
39 }
40 if (!loadResult.baseUrl) {
41 return {
42 resultType: "failed",
43 message: "Missing baseUrl in compilerOptions",
44 };
45 }
46 var tsConfigDir = path.dirname(loadResult.tsConfigPath);
47 var absoluteBaseUrl = path.join(tsConfigDir, loadResult.baseUrl);
48 return {
49 resultType: "success",
50 configFileAbsolutePath: loadResult.tsConfigPath,
51 baseUrl: loadResult.baseUrl,
52 absoluteBaseUrl: absoluteBaseUrl,
53 paths: loadResult.paths || {},
54 };
55}
56exports.configLoader = configLoader;
57//# sourceMappingURL=config-loader.js.map
Note: See TracBrowser for help on using the repository browser.