Skip to content

Commit 579d066

Browse files
fix: Typescript build by adding static types dependency list
By default typescript tries to build any given types available in its build scope but that brings some issue when the consumer project import types dependencies because tsc would then try to compile them as well whereas they should remains out of the build scope of the library. In order to solve this I've statically listed all types dependencies of this project in the types attribute of ts config file.
1 parent 909fbc0 commit 579d066

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
"rootDir": "src",
1414
"strict": true,
1515
"forceConsistentCasingInFileNames": true,
16-
"importHelpers": true
16+
"importHelpers": true,
1717
// enable this when it works with tslint, or we switch to prettier
1818
// "declarationMap": true
19+
"types": ["js-yaml", "node", "request", "underscore", "ws", "byline", "chai", "chai-as-promised", "mocha", "mock-fs", "stream-buffers"]
1920
},
2021
"exclude": [
2122
"node_modules",

0 commit comments

Comments
 (0)