tsconfig.json
{//tsconfig.json是ts的编译器的配置文件,ts编译器可以根据他的信息来对代码进行编译/*include:用来指定哪些ts文件需要被编译路径:**表示任意目录* 表示任意文件exclued:不需要被编译对文件目录默认值:["node_modules","bower_components","jspm_packages"]*/"include": ["./src/**/*"],// "exclude": [// "./src/hello"// ]/*compilerOptions*/"compilerOptions": {//target 用来指定被编译的js版本//'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'esnext'"target": "es2015",//moudule:指定要使用模块化规范//'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'esnext'"module": "amd",//lib:用来指定项目中要使用的库//'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'esnext',//'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost',//'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise',//'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include',// 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays',//'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp',//'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.bigint', 'es2020.promise',//'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2021.promise',//'es2021.string', 'es2021.weakref', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl',// 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref'.//"lib":[]//outDir 用来指定编译后的文件的目录"outDir": "./dist",//outFile 将代码合并为一个文件"outFile": "./dist/app.js",//allowJs 是否对js文件进行编译,默认是false"allowJs": true,//checkJs 是否检查js代码符合ts语法规范,默认是false"checkJs": true,//removeComments 是否移除注释,默认是false"removeComments": true,//noEmit 不生成编译后的文件,默认是false"noEmit":false,//noEmitOnError 当有错误时不生成编译后的文件,默认是false"noEmitOnError": true,//所有严格检查的总开关"strict": true,//alwaysStrict 用来设置编译后的文件是否使用严格模式,默认是false"alwaysStrict": true,//noImplicitAny 不允许使用隐式的any类型"noImplicitAny": true,//不允许使用不明确类的this"noImplicitThis": true,//严格的检查空值"strictNullChecks": true,}}
其他配置:https://blog.csdn.net/xiaotiantian1993s/article/details/91536379
