Looking to achieve a specific project structure:
- tsconfig.json
- src
- app.ts
- tests
- appTest.ts
- appTest.js
- dist
- app.js
If the tests
folder did not exist, this tsconfig.json configuration would suffice:
{
"compilerOptions": {
"outDir":"dist"
},
"include" :[
"src/**/*.ts"
]
}
However, when adding tests/**/*.ts
to the include
section, it will compile the test files into dist
as well, altering the folder structure unintentionally.
Is there a way to instruct the TypeScript compiler to include test files for project support (like refactoring) but avoid including them in the dist
output? Ideally, I want the .js
files to be compiled in the tests
directory, as shown in the desired project structure above.