我希望我的打字稿测试在test文件夹与src. 我不希望在构建打字稿项目时转换测试。
我的打字稿节点项目的结构如下:
.
??? server
? ?
? ?
? ??? src
? ? ?
? ? ??? app.ts
? ??? test
? ? ?
? ? ??? app.test.ts
? ??? node_modules/
? ??? package-lock.json
? ??? package.json
? ??? tslint.json
? ??? tsconfig.json
??? front_end/
??? README.md
Run Code Online (Sandbox Code Playgroud)
使用我的 tsconfig:
{
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
"sourceMap": true,
"strict": true,
"target": "ESNext",
"paths": {
"*": ["node_modules/*"]
}
},
"include": ["src/**/*"] …Run Code Online (Sandbox Code Playgroud)