![](/img/trans.png)
[英]Typescript: compile to more than one .js file in Visual Studio 2013
[英]Exclude file from Typescript compile effect into one output JS in Visual Studio
我有一個打字稿項目,可以用VS編譯成單個文件。 一切工作正常,但是目標環境中已經有一個庫,並且由於它有3000行,因此我希望將其從編譯到輸出文件中排除。 不幸的是,該庫不是d.ts文件,只是.ts一個。 有沒有辦法從編譯中排除它?
更新:我添加了tsconfig.json文件。 它不排除我要排除的文件。 這是因為在其他文件中引用了它嗎? 我的congif.json:
{
"compilerOptions": {
"outFile": "../pathTo/my/otuputFile.js",
"outDir": "./pathTo/my/",
"removeComments": false
},
"files": [
"../allmy/files/lsited.ts"
],
"exclude": [
"libraryIdontwant.ts"
]
}
在您的tsconfig.json
將其添加到排除數組
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts",
"path/to/the/file.ts"
]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.