【TypeScript系列】编译选项

编译选项

编译选项

选项 类型 默认值 描述
--allowJs boolean false 允许编译javascript文件。
--allowSyntheticDefaultImports boolean module === "system"或设置了--esModuleInterop 允许从没有设置默认导出的模块中默认导入。这并不影响代码的输出,仅为了类型检查。
--allowUnreachableCode boolean false 不报告执行不到的代码错误。
--allowUnusedLabels boolean false 不报告未使用的标签错误。
--alwaysStrict boolean false 以严格模式解析并为每个源文件生成"use strict"语句
--baseUrl string 解析非相对模块名的基准目录。查看模块解析文档了解详情。
--build -b boolean false 使用Project References来构建此工程及其依赖工程。注意这个标记与本页内其它标记不兼容。详情参考这里
--charset string "utf8" 输入文件的字符集。
--checkJs boolean false 在.js文件中报告错误。与--allowJs配合使用。
--composite boolean true 确保TypeScript能够找到编译当前工程所需要的引用工程的输出位置。
--declaration -d boolean false 生成相应的.d.ts文件。
--declarationDir string 生成声明文件的输出路径。
--diagnostics boolean false 显示诊断信息。
--disableSizeLimit boolean false 禁用JavaScript工程体积大小的限制
--emitBOM boolean false 在输出文件的开头加入BOM头(UTF-8 Byte Order Mark)。
--emitDecoratorMetadata[1] boolean false 给源码里的装饰器声明加上设计类型元数据。查看issue #2577了解更多信息。
--experimentalDecorators[1] boolean false 启用实验性的ES装饰器。
--extendedDiagnostics boolean false 显示详细的诊段信息。
--forceConsistentCasingInFileNames boolean false 禁止对同一个文件的不一致的引用。
--generateCpuProfile string profile.cpuprofile 在指定目录生成CPU资源使用报告。若传入的是已创建的目录名,将在此目录下生成以时间戳命

你可能感兴趣的:(TypeScript,typescript,javascript,前端)