Say I put my code under src
and tests under spec
:
+ spec
+ --- classA.spec.ts
+ src
+ --- classA.ts
+ --- classB.ts
+ --- index.ts
+ tsconfig.json
I want to only transpile src
to the dist
folder. Since index.ts
is the entry point of my package, my tsconfig.json
look like this:
{
"compileOptions": {
"module": "commonjs"
"outDir": "dist"
},
"files": {
"src/index.ts",
"typings/main.d.ts"
}
}
However, this tsconfig.json
does not include the test files so I could not resolve dependencies in them.
On the other hand, if I include the test files into tsconfig.json
then they are also transpiled to dist
folder.
How do I solve this problem?