4
私のタイスクリプトファイルをコンパイルするビジュアルスタジオコードにこのタスクがあります。 1つのフォルダにすべてのタイプスクリプトを追加し、別のフォルダにすべてのJavaScriptを追加することで、よりクリーンなファイル構造にしたいと考えています。そうするために私の仕事の議論をどのように変えるのですか?現在のコードでは、出力がtypescriptと同じフォルダにコンパイルされます。現在のコードは次のとおりです。出力ディレクトリを指定してVisual Studioのコードタスクでtypescriptをコンパイルします
{
"version": "0.1.0",
// The command is tsc. Assumes that tsc has been installed using npm install -g typescript
"command": "tsc",
// The command is a shell script
"isShellCommand": true,
// Show the output window only if unrecognized errors occur.
"showOutput": "silent",
// args is the HelloWorld program to compile.
"args": [
"scripts/front_end/view_models/search_filter_view_model.ts",
"scripts/front_end/models/area_getter.ts",
"scripts/front_end/bootstrap_app.ts",
"scripts/front_end/models/category.ts",
"scripts/front_end/plugins/slideshow.ts"
],
// use the standard tsc problem matcher to find compile problems
// in the output.
"problemMatcher": "$tsc"
}
ありがとうございました。 outDirはjsファイルが入っているディレクトリですか? tsファイルから来たすべてのjが1つのファイル(client/build/all.js)に入れられていますか?あなたのjsはすべてclient/build/all.jsにありますか? – BeniaminoBaggins
'outDir'はすべてのjsファイルのビルドが行われるディレクトリです。' outFile'はほぼ同じですが、違いはバンドル(すべてのjsファイル)ファイル名が含まれている点です。これは、 'include'セクション内に記述されたtsファイルから変換されたすべてのjsファイルを含みます。 tsconfig.jsonファイルのパスは、前述のフォルダパスからの相対パスです。コンパイル時にチェックしてください。 – Gary