sync Compiler Options in MSBuild.md
This commit is contained in:
parent
61d77d5bab
commit
ce113377f1
@ -5,71 +5,87 @@
|
||||
## 例子
|
||||
|
||||
```XML
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
||||
<TypeScriptRemoveComments>false</TypeScriptRemoveComments>
|
||||
<TypeScriptSourceMap>true</TypeScriptSourceMap>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
||||
<TypeScriptRemoveComments>true</TypeScriptRemoveComments>
|
||||
<TypeScriptSourceMap>false</TypeScriptSourceMap>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets"
|
||||
Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
||||
<TypeScriptRemoveComments>false</TypeScriptRemoveComments>
|
||||
<TypeScriptSourceMap>true</TypeScriptSourceMap>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
||||
<TypeScriptRemoveComments>true</TypeScriptRemoveComments>
|
||||
<TypeScriptSourceMap>false</TypeScriptSourceMap>
|
||||
</PropertyGroup>
|
||||
<Import
|
||||
Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets"
|
||||
Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />
|
||||
```
|
||||
|
||||
## 映射
|
||||
|
||||
编译选项 | MSBuild属性名称 | 可用值
|
||||
编译选项 | MSBuild属性名称 | 可用值
|
||||
---------------------------------------------|--------------------------------------------|-----------------
|
||||
`--declaration` | TypeScriptGeneratesDeclarations | 布尔值
|
||||
`--module` | TypeScriptModuleKind | `AMD`, `CommonJs`, `UMD` 或 `System`
|
||||
`--target` | TypeScriptTarget | `ES3`, `ES5`, or `ES6`
|
||||
`--allowJs` | *MSBuild不支持此选项* |
|
||||
`--allowSyntheticDefaultImports` | TypeScriptAllowSyntheticDefaultImports | 布尔值
|
||||
`--allowUnreachableCode` | TypeScriptAllowUnreachableCode | 布尔值
|
||||
`--allowUnusedLabels` | TypeScriptAllowUnusedLabels | 布尔值
|
||||
`--baseUrl` | TypeScriptBaseUrl | 文件路径
|
||||
`--charset` | TypeScriptCharset |
|
||||
`--declaration` | TypeScriptGeneratesDeclarations | 布尔值
|
||||
`--declarationDir` | TypeScriptDeclarationDir | 文件路径
|
||||
`--diagnostics` | *MSBuild不支持此选项* |
|
||||
`--emitBOM` | TypeScriptEmitBOM | 布尔值
|
||||
`--emitDecoratorMetadata` | TypeScriptEmitDecoratorMetadata | 布尔值
|
||||
`--experimentalAsyncFunctions` | TypeScriptExperimentalAsyncFunctions | 布尔值
|
||||
`--experimentalDecorators` | TypeScriptExperimentalDecorators | 布尔值
|
||||
`--forceConsistentCasingInFileNames` | TypeScriptForceConsistentCasingInFileNames | 布尔值
|
||||
`--help` | *MSBuild不支持此选项* |
|
||||
`--inlineSourceMap` | TypeScriptInlineSourceMap | 布尔值
|
||||
`--inlineSources` | TypeScriptInlineSources | 布尔值
|
||||
`--locale` | *自动的* | 自动设置成PreferredUILang的值
|
||||
`--init` | *MSBuild不支持此选项* |
|
||||
`--isolatedModules` | TypeScriptIsolatedModules | 布尔值
|
||||
`--jsx` | TypeScriptJSXEmit | `React`或`Preserve`
|
||||
`--lib` | TypeScriptLib | 逗号分隔的字符串列表
|
||||
`--listEmittedFiles` | *MSBuild不支持此选项* |
|
||||
`--listFiles` | *MSBuild不支持此选项* |
|
||||
`--locale` | *automatic* | 自动设置为PreferredUILang值
|
||||
`--mapRoot` | TypeScriptMapRoot | 文件路径
|
||||
`--newLine` | TypeScriptNewLine | `CRLF` 或 `LF`
|
||||
`--noEmitOnError` | TypeScriptNoEmitOnError | 布尔值
|
||||
`--module` | TypeScriptModuleKind | `AMD`,`CommonJs`,`UMD`,`System`或`ES6`
|
||||
`--moduleResolution` | TypeScriptModuleResolution | `Classic`或`Node`
|
||||
`--newLine` | TypeScriptNewLine | `CRLF`或`LF`
|
||||
`--noEmit` | *MSBuild不支持此选项* |
|
||||
`--noEmitHelpers` | TypeScriptNoEmitHelpers | 布尔值
|
||||
`--noEmitOnError` | TypeScriptNoEmitOnError | 布尔值
|
||||
`--noFallthroughCasesInSwitch` | TypeScriptNoFallthroughCasesInSwitch | 布尔值
|
||||
`--noImplicitAny` | TypeScriptNoImplicitAny | 布尔值
|
||||
`--noImplicitReturns` | TypeScriptNoImplicitReturns | 布尔值
|
||||
`--noImplicitThis` | TypeScriptNoImplicitThis | 布尔值
|
||||
`--noImplicitUseStrict` | TypeScriptNoImplicitUseStrict | 布尔值
|
||||
`--noUnusedLocals` | TypeScriptNoUnusedLocals | 布尔值
|
||||
`--noUnusedParameters` | TypeScriptNoUnusedParameters | 布尔值
|
||||
`--noLib` | TypeScriptNoLib | 布尔值
|
||||
`--noResolve` | TypeScriptNoResolve | 布尔值
|
||||
`--out` | TypeScriptOutFile | 文件路径
|
||||
`--outDir` | TypeScriptOutDir | 文件路径
|
||||
`--outFile` | TypeScriptOutFile | 文件路径
|
||||
`--paths` | *MSBuild不支持此选项* |
|
||||
`--preserveConstEnums` | TypeScriptPreserveConstEnums | 布尔值
|
||||
`--listEmittedFiles` | *MSBuild不支持此选项* |
|
||||
`--pretty` | *MSBuild不支持此选项* |
|
||||
`--reactNamespace` | TypeScriptReactNamespace | 字符串
|
||||
`--removeComments` | TypeScriptRemoveComments | 布尔值
|
||||
`--rootDir` | TypeScriptRootDir | 文件路径
|
||||
`--isolatedModules` | TypeScriptIsolatedModules | 布尔值
|
||||
`--rootDirs` | *MSBuild不支持此选项* |
|
||||
`--skipLibCheck` | TypeScriptSkipLibCheck | 布尔值
|
||||
`--skipDefaultLibCheck` | TypeScriptSkipDefaultLibCheck | 布尔值
|
||||
`--sourceMap` | TypeScriptSourceMap | 文件路径
|
||||
`--sourceRoot` | TypeScriptSourceRoot | 文件路径
|
||||
`--strictNullChecks` | TypeScriptStrictNullChecks | 布尔值
|
||||
`--suppressImplicitAnyIndexErrors` | TypeScriptSuppressImplicitAnyIndexErrors | 布尔值
|
||||
`--suppressExcessPropertyErrors` | TypeScriptSuppressExcessPropertyErrors | 布尔值
|
||||
`--moduleResolution` | TypeScriptModuleResolution | `Classic` or `Node`
|
||||
`--experimentalAsyncFunctions` | TypeScriptExperimentalAsyncFunctions | 布尔值
|
||||
`--jsx` | TypeScriptJSXEmit | `React` or `Preserve`
|
||||
`--reactNamespace` | TypeScriptReactNamespace | string
|
||||
`--skipDefaultLibCheck` | TypeScriptSkipDefaultLibCheck | 布尔值
|
||||
`--allowUnusedLabels` | TypeScriptAllowUnusedLabels | 布尔值
|
||||
`--noImplicitReturns` | TypeScriptNoImplicitReturns | 布尔值
|
||||
`--noFallthroughCasesInSwitch` | TypeScriptNoFallthroughCasesInSwitch | 布尔值
|
||||
`--allowUnreachableCode` | TypeScriptAllowUnreachableCode | 布尔值
|
||||
`--forceConsistentCasingInFileNames` | TypeScriptForceConsistentCasingInFileNames | 布尔值
|
||||
`--allowSyntheticDefaultImports` | TypeScriptAllowSyntheticDefaultImports | 布尔值
|
||||
`--noImplicitUseStrict` | TypeScriptNoImplicitUseStrict | 布尔值
|
||||
`--project` | *VS不支持* |
|
||||
`--watch` | *VS不支持* |
|
||||
`--diagnostics` | *VS不支持* |
|
||||
`--listFiles` | *VS不支持* |
|
||||
`--noEmit` | *VS不支持* |
|
||||
`--allowJs` | *VS不支持* |
|
||||
*VS特有选项* | TypeScriptAdditionalFlags | *任意编译选项*
|
||||
`--suppressImplicitAnyIndexErrors` | TypeScriptSuppressImplicitAnyIndexErrors | 布尔值
|
||||
`--target` | TypeScriptTarget | `ES3`,`ES5`,或`ES6`
|
||||
`--traceResolution` | *MSBuild不支持此选项* |
|
||||
`--types` | *MSBuild不支持此选项* |
|
||||
`--typeRoots` | *MSBuild不支持此选项* |
|
||||
`--watch` | *MSBuild不支持此选项* |
|
||||
*MSBuild only option* | TypeScriptAdditionalFlags | *任何编译选项*
|
||||
|
||||
## 我使用的Visual Studio版本里支持哪些选项?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user