当前位置:网站首页>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
边栏推荐
猜你喜欢

Display of receiving address list 【 project mall 】
![[file upload vulnerability 05] server suffix detection and bypass experiment (based on upload-labs-3 shooting range)](/img/f5/52bc5e01bb0607b6ecab828fb70c93.jpg)
[file upload vulnerability 05] server suffix detection and bypass experiment (based on upload-labs-3 shooting range)

How does Sister Feng change to ice?

The role of Gerber file in PCB manufacturing

Cap theory sounds very big, but it's actually very simple

装饰模式--小美的生日蛋糕

Appearance mode -- it has been used in various packages for a long time!

Typeerror: argument of type "Int 'is not Iterable

JS 加法乘法错误解决 number-precision

Template engine - thymeleaf
随机推荐
How should ordinary people choose annuity insurance products?
17.5 concept, usage, deadlock demonstration and solution of mutex
Use compiler option ‘--downlevelIteration‘ to allow iterating of iterators 报错解决
Template engine - thymeleaf
How does Sister Feng change to ice?
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:
统计出现次数最多的前K个字符串
Problems encountered when using nailing intranet to penetrate and upload PHP projects
Uncaught TypeError: Cannot set property ‘next‘ of undefined 报错解决
Etcd的运行时重配置
js合并两个对象(面试题)
Maximum water container
How to form a good habit? By perseverance? By determination? None of them!
Collection of practical WordPress plug-ins (under update)
設置默認收貨地址【項目 商城】
The application of the spingboot+quartrz production environment supports distributed, custom corn, reflective execution of multiple tasks
装饰模式--小美的生日蛋糕
Eulato
202年最新热门收益较高的年金险产品是什么?
AcWing 1353. 滑雪场设计(贪心)