Skip to content

Commit

Permalink
chore: export types
Browse files Browse the repository at this point in the history
  • Loading branch information
dextertanyj committed Aug 21, 2023
1 parent 9557ec9 commit dfb9ef1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"exports": {
".": {
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js"
"require": "./lib/cjs/index.js",
"types": "./lib/types/index.js"
},
"./package.json": "./package.json"
},
Expand All @@ -36,9 +37,10 @@
"prepare": "husky install",
"pre-commit": "lint-staged",
"prepack": "npm run build",
"build": "npm run build:esm && npm run build:cjs",
"build": "npm run build:esm && npm run build:cjs && npm run build:types",
"build:esm": "tsc -p tsconfig.esm.json",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:types": "tsc -p tsconfig.types.json",
"lint": "eslint --ext ts,js .",
"lint:fix": "eslint --fix --ext ts,js .",
"clean": "git clean -xdf node_modules lib"
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
"rootDir": "./src",
"outDir": "./lib/cjs",
"module": "commonjs",
"declaration": false,
"declarationMap": false,
}
}
2 changes: 2 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
"rootDir": "./src",
"outDir": "./lib/esm",
"module": "ES6",
"declaration": false,
"declarationMap": false,
}
}
11 changes: 11 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"exclude": ["tests/**/*"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib/types",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true
},
}

0 comments on commit dfb9ef1

Please sign in to comment.