私が持っているもの:
./src/myfile.ts
./test/mytest.spec.ts
そして、tscは javascript ( myfile.js
) と定義ファイル ( myfile.d.ts
) をその./build
場所に作成する必要があります。
私の tsconfig.ts:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"rootDir": ".",
"outDir": "./build",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"declaration": true
},
"files": [
"./src/index.ts"
],
"exclude": [
".vscode",
".git",
"build",
"node_modules",
"test"
],
"compileOnSave": false,
"buildOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
ただし、この構成ファイルmyfile.js
は./build/src/
サブフォルダーに を生成します。
テストフォルダーがコンパイルされていないため、使用できないことに注意してください"rootDir": "./src"
(カルマ+ webpackでテストを実行すると問題が発生しますか?)