Skip to content

Commit 806cd2f

Browse files
authored
Fix broken module resolution (#131)
1 parent b553a97 commit 806cd2f

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/Util.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ import {ApiErrorResponseSchema} from "./kms/KmsApi";
44
import {TenantSecurityErrorCode, TenantSecurityException} from "./TenantSecurityException";
55
import {TenantSecurityExceptionUtils} from "./TenantSecurityExceptionUtils";
66
import {TspServiceException} from "./TspServiceException";
7-
import {version} from "../package.json";
87
import * as Crypto from "./kms/Crypto";
98
import * as DetCrypto from "./kms/DeterministicCrypto";
109
import * as http from "http";
1110
import * as https from "https";
1211
import * as Joi from "joi";
1312

13+
// Loaded via require so tsc doesn't include package.json in the program and
14+
// elevate the inferred rootDir above ./src (which would nest the build output).
15+
// eslint-disable-next-line @typescript-eslint/no-var-requires
16+
const {version} = require("../package.json") as {version: string};
17+
1418
/**
1519
* Try to JSON parse error responses from the TSP to extract error codes and messages.
1620
*/

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"noUnusedLocals": true,
99
"declaration": false,
1010
"target": "ES6",
11+
"rootDir": "./src",
1112
"module": "commonjs",
1213
"moduleResolution": "node",
1314
"resolveJsonModule": true,

0 commit comments

Comments
 (0)