zoukankan      html  css  js  c++  java
  • Typescript编译设置

    TypeScript MSBuild编译选项,用记事本打开工程文件,进行修改,如<TypeScriptGeneratesDeclarations>true</TypeScriptGeneratesDeclarations>表示自动生成.d.ts定义文件,不用手动写.d.ts文件,多方便

    在MSBuild里使用编译选项

    概述

    编译选项可以在使用MSBuild的项目里通过MSBuild属性指定。

    例子

    <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)MicrosoftVisualStudiov$(VisualStudioVersion)TypeScriptMicrosoft.TypeScript.targets"
            Condition="Exists('$(MSBuildExtensionsPath32)MicrosoftVisualStudiov$(VisualStudioVersion)TypeScriptMicrosoft.TypeScript.targets')" />
    

    映射

    编译选项MSBuild属性名称可用值
    --declaration TypeScriptGeneratesDeclarations 布尔值
    --module TypeScriptModuleKind AMDCommonJsUMD 或 System
    --target TypeScriptTarget ES3ES5, or ES6
    --charset TypeScriptCharset  
    --emitBOM TypeScriptEmitBOM 布尔值
    --emitDecoratorMetadata TypeScriptEmitDecoratorMetadata 布尔值
    --experimentalDecorators TypeScriptExperimentalDecorators 布尔值
    --inlineSourceMap TypeScriptInlineSourceMap 布尔值
    --inlineSources TypeScriptInlineSources 布尔值
    --locale 自动的 自动设置成PreferredUILang的值
    --mapRoot TypeScriptMapRoot 文件路径
    --newLine TypeScriptNewLine CRLF 或 LF
    --noEmitOnError TypeScriptNoEmitOnError 布尔值
    --noEmitHelpers TypeScriptNoEmitHelpers 布尔值
    --noImplicitAny TypeScriptNoImplicitAny 布尔值
    --noUnusedLocals TypeScriptNoUnusedLocals 布尔值
    --noUnusedParameters TypeScriptNoUnusedParameters 布尔值
    --noLib TypeScriptNoLib 布尔值
    --noResolve TypeScriptNoResolve 布尔值
    --out TypeScriptOutFile 文件路径
    --outDir TypeScriptOutDir 文件路径
    --preserveConstEnums TypeScriptPreserveConstEnums 布尔值
    --removeComments TypeScriptRemoveComments 布尔值
    --rootDir TypeScriptRootDir 文件路径
    --isolatedModules TypeScriptIsolatedModules 布尔值
    --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 任意编译选项

  • 相关阅读:
    CSS记录
    ssl各种证书区别
    【PG数据库】PG数据库的安装及连接方法
    linux 系统 如何 安装 python (python 3.8)
    【学习数据结构数据结构入门1】什么是数据结构?
    Javascript实现复制功能,兼容所有浏览器问题及注意事项
    浏览器版本的全部信息(Javascript)
    正则表达式——多邮箱地址检测 (Regular Expression Mutil Email Checking)
    Fusion网站开发总结_2012322
    CSS开发总结_2012322
  • 原文地址:https://www.cnblogs.com/IWings/p/6656535.html
Copyright © 2011-2022 走看看