Skip to content

Commit

Permalink
Merge pull request #338 from microwavekonijn/master
Browse files Browse the repository at this point in the history
fix: export types in separate directory
  • Loading branch information
jwalton authored Jul 27, 2023
2 parents 03b6970 + 0cc9859 commit 2d5aaeb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -66,7 +66,7 @@
"scripts": {
"prepare": "husky install && npm run build",
"prepublishOnly": "npm run build",
"build": "tsc && tsc -p tsconfig.cjs.json && ./bin/build-types.sh",
"build": "tsc && tsc -p tsconfig.cjs.json && tsc -p tsconfig.types.json && ./bin/build-types.sh",
"clean": "rm -rf dist types coverage",
"test": "npm run test:lint && npm run test:unittest",
"test:unittest": "tsc -p test && jest --coverage",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./dist/types"
}
}

0 comments on commit 2d5aaeb

Please sign in to comment.