1
假設我們有以下文件:如何編譯擴展名爲* .server.ts的所有文件?
/mymodule1/
main.server.ts
main.client.ts
/mymodule2/
main.server.ts
main.client.ts
我們如何只編譯所有的* .server.ts文件,但離開* .client.ts文件保持原樣?
我想這樣的事情在我的tsconfig.json但它失敗:
tsconfig.json,使用TSC CLI時:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true
},
"files": [
"**/*.server.ts"
]
}
[編輯]
或類似的東西:
tsconfig.json,使用凌時:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true
},
"filesGlob": [
"**/*.server.ts" //seams to work, but Atom complains that the other files are not added to the compile context.
],
"exclude": [
"**/*.client.ts", //fails, as well as in files
"typings",
"node_modules"
]
}
是否有filesExcludeGlob?
謝謝您的回覆! 我應該提到我已經用Atom和tsc cli嘗試過了。 你喜歡提供一個工作示例嗎?哪個工具無關緊要。 – daslicht