diff --git a/package.json b/package.json index 88ea233..e9f6431 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onfido/api", - "version": "1.5.1", + "version": "1.5.2", "description": "Node.js library for the Onfido API", "keywords": [ "onfido", diff --git a/src/ignoreJson.d.ts b/src/ignoreJson.d.ts new file mode 100644 index 0000000..3c63c18 --- /dev/null +++ b/src/ignoreJson.d.ts @@ -0,0 +1,2 @@ +// Using resolveJsonModule with TypeScript and importing package.json causes issues because it causes rootDir to change to . instead of ./src, which means generated type declarations get output in dist/src rather than just dist. Since rollup inserts JSON directly we can just ignore JSON modules in TypeScript. +declare module "*.json"; diff --git a/test/tsconfig.json b/test/tsconfig.json index 8ec619d..5c24bf3 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -3,6 +3,7 @@ "include": ["./**/*"], "compilerOptions": { "baseUrl": "../", + "resolveJsonModule": true, "paths": { "onfido-node": ["src/index"] } diff --git a/tsconfig.json b/tsconfig.json index 0a7f15d..bd8c960 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "sourceMap": true, "declaration": true, "esModuleInterop": true, - "resolveJsonModule": true + "rootDir": "src" }, "include": ["src/**/*"] }