当前位置:网站首页>Typescript compilation options and configuration files
Typescript compilation options and configuration files
2022-06-11 11:41:00 【Michael18811380328】
typescript Compile options and configuration files
Use TS When the front-end project is completed , It's usually necessary to put TS Compiled into different versions JS, Then use it with other files .
Profile description
Configuration items are placed in tsconfig.json in , It mainly includes the following configurations
* Yes tsconfig.json The directory of the file is a Typescript project
* tsc No input file
: Look up from the current position tsconfig.json
:--project Catalog ( contain tsconfig.json) | .json file
* If there is an input file, ignore tsconfig.json
* attribute files: Files to compile
* attribute include: Included files
* attribute exclude: Excluded documents
* attribute compilerOptions: Compilation options
* glob-like file patterns, Water drop mode
:* = Zero or more characters ( Do not include directory separator )
:? = A character
:**/ = Recursively match subdirectories
:(* or .*) matching .ts, .tsx, .d.ts and .jsx(allowJs = true)
* Is not specified files and include: In the current directory and subdirectories typescript file
* At the same time specified files and include: Union and collection
* Is not specified exclude, Exclude by default outDir
* exclude Can be ruled out include, Cannot be excluded files
* exclude Default node_modules, bower_components, jspm_packages and <outDir>
* The referenced documents will also be included
* It is possible that input files will not be included , It is not recommended to use a file with the same name ( Different extensions )
* tsconfig.json Empty can also
* Command line options take precedence
* node_modules/@types Will be included , And so on
* typeRoots Restricted the root directory
* types If you are , Only those specified will be included ./node_modules/@types/node ...、
* type package:1) Yes index.d.ts Folder ;2)package.json that has a types field
* Auto include only in Global declarations It's important , Use import Unwanted
* attribute extends You can inherit the configuration
* extends Is a top-level attribute , The value is Path to another configuration file
* Local configuration overrides inherited configuration , If you inherit from each other, you will report an error
* The path is relative to each configuration file
* compileOnSave: Top attributes , At present, only for VS2015 The above is effective
Description of compilation options
Compilation options , It refers to the compilation process , How to operate
typescript Compilation options
-- allowJs = false:js Files are also compiled
-- allowUnreachableCode = false: Do you want to report an error for the code that is impossible to execute
-- allowUnusedLabels = false: Not used label Do you want to report an error
-- alwaysStrict = false: Parse and output in strict mode
-- build = false: Produce current projects and dependent projects
-- charset = "utf-8": Input the character set of the file
-- checkJs = false:js Do you want to report the error of the file
-- declaration = false: Generate corresponding .d.ts file
-- declarationDir = null: Where to put the declaration file
-- declarationMap = false: Production declaration document sourcemap
-- diagnostics = false: Display diagnostic information
-- disableSizeLimit = false: Remove the item size limit
-- downlevelIteration = false: oriented ES5 and ES3 when , take for..of, spread and destructuring Downgrade
-- emitBOM = false: The input file code is with BOM
-- emitDeclarationOnly = false: Output only the declaration file
-- forceConsistentCasingInFileNames = false: Enforce file name case consistency
-- help: help
-- inlineSources = false: inline sourcemap
-- inlineSources = false: Inline source code , It needs to be set at the same time inlineSources and sourcemap
-- init: Initialize a project
-- isolatedModules = false: Each file is a separate module
-- jsx = "Preserve":jsx Processing mode
-- jsxFactory = "React.createElement":jsx The factory method of
-- keyofStringsOnly = false:keyof Use only string keys to parse
-- lib: Libraries to use when compiling
:ES5: DOM,ES5,ScriptHost
:ES6: DOM,ES6,DOM.Iterable,ScriptHost
-- listEmittedFiles = false: List the generated file names
-- listFiles = false: List the generated file names
-- locale: Error message language
-- module: How to generate module code
:"None", "CommonJS", "AMD", "System", "UMD", "ES6", "ES2015" or "ESNext".
-- watch: Keep an eye on the input file
-- target = "ES3": Target criteria
:"ES3" (default), "ES5", "ES6"/"ES2015", "ES2016", "ES2017" or "ESNext".
-- showConfig = false: Only the configuration
-- removeComments = fasle: Remove comments
-- project: Specify profile
-- pretty = true: Beautify the output
--preserveConstEnums = false: Keep constant and enumeration declarations
--noEmit: Don't output
--noEmitOnError: Do not output when there is an error
边栏推荐
- AcWing 1353. Ski resort design (greedy)
- Template engine - thymeleaf
- JEST 单元测试说明 config.json
- js合并两个对象(面试题)
- Use pydub to modify the bit rate of the wav file, and an error is reported: c:\programdata\anaconda3\lib\site packages\pydub\utils py:170: RuntimeWarning:
- Centos7.x下安装mysql8遇到的问题Couldn‘t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
- 浙大联合微软亚研院发布视频识别新方法,可对视频逐帧识别且无需,数据标记,或可用于手语翻译等
- Etcd介绍
- Learning in Bi design 03
- Collection of practical WordPress plug-ins (under update)
猜你喜欢

The role of Gerber file in PCB manufacturing

The tutor transferred me 800 yuan and asked me to simulate a circuit (power supply design)

JS prototype. The find () method has no effect on the object array. It is urgent...

李飞飞:我更像物理学界的科学家,而不是工程师|深度学习崛起十年

找到自己的优势,才能干活不累,事半功倍!

web开发选型,web开发毕业谁

JS interview questions - arrow function, find and filter some and every

Use pydub to modify the bit rate of the wav file, and an error is reported: c:\programdata\anaconda3\lib\site packages\pydub\utils py:170: RuntimeWarning:

SpingBoot+Quartrz生产环境的应用支持分布式、自定义corn、反射执行多任务

Node connects to MySQL database and writes fuzzy query interface
随机推荐
Learn 02 - slice, morphological change and dimension exchange of numpy multidimensional array
Mongodb usage
Publish WordPress database cache plug-in: DB cache reloaded 3.1
How does Sister Feng change to ice?
发布WordPress数据库缓存插件:DB Cache Reloaded 3.1
Runtime reconfiguration of etcd
Définir l'adresse de réception par défaut [Centre commercial du projet]
Etcd introduction
MyCat-分库分表
测试cos-html-cache静态缓存插件
Split data - horizontal split and vertical split
17.4 creating multiple threads, data sharing problem analysis and case code
Dominating set, independent set, covering set
全国多年太阳辐射空间分布数据1981-2022年、气温分布数据、蒸散量数据、蒸发量数据、降雨量分布数据、日照数据、风速数据
How to form a good habit? By perseverance? By determination? None of them!
在畢設中學習03
文件excel导出
AcWing 1944. Record keeping (hash, STL)
Use yolov3 to train yourself to make datasets and get started quickly
Web development model selection, who graduated from web development