From 5d6cdbfc9340c2b8a2b93d40277656ccaa937cae Mon Sep 17 00:00:00 2001 From: Microwavekonijn Date: Sun, 23 Jul 2023 23:36:50 +0200 Subject: [PATCH] fix: export types in separate directory --- package.json | 4 ++-- tsconfig.json | 2 +- tsconfig.types.json | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 tsconfig.types.json diff --git a/package.json b/package.json index 6717fda..993ae2e 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "description": "Auto-reconnect and round robin support for amqplib.", "module": "./dist/esm/index.js", "main": "./dist/cjs/index.js", - "types": "./dist/esm/index.d.ts", + "types": "./dist/types/index.d.ts", "exports": { ".": { - "types": "./dist/esm/index.d.ts", + "types": "./dist/types/index.d.ts", "import": "./dist/esm/index.js", "require": "./dist/cjs/index.js", "default": "./dist/cjs/index.js" diff --git a/tsconfig.json b/tsconfig.json index 1d88c6a..e0e73ae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,7 @@ "lib": ["es2018"], "allowJs": false, // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, + "declaration": false, "sourceMap": true, "outDir": "./dist/esm", "stripInternal": true, diff --git a/tsconfig.types.json b/tsconfig.types.json new file mode 100644 index 0000000..63f9d9b --- /dev/null +++ b/tsconfig.types.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "./dist/types" + } +}