tsconfig.json配置
{
/* 编译路径
**表示文件夹下的所有文件夹,
*表示文件夹下的所有文件
*/
"include": ["./src/**/*"],
/* 排除路径 不参加编译的文件路径
默认值[”node_modules“,"bower_components","jspm_packages"]
*/
"exclude": ["./hellow/**/*"]
}
compilerOptions配置选项
/*
compilerOptions编译器选项
*/
"compilerOptions":{
//target 用来指定TS被编译的ES的版本
//'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'.
"target": "ES2015",
//module
//'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'.
"module": "ES2015",
//lib用来指定使用的库
//option must be:
//'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019',
//'es2020', 'es2021', 'es2022', 'es2023', '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', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl',
//'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp',
// 'es2023.array', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable',
// 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref',
// 'decorators', 'decorators.legacy'.
/* "lib": ["12"] */
//outDir 用来指定编译后文件所在目录
"outDir": "./dist",
//outFile 将代码合并为一个文件
//设置outfile后,所有的全局代码合并到一个文件中
//但是只支持system,amd
/* "outFile": "./dist/app.js" */
//allowJs 是否对JS文件进行编译
"allowJs": false,
//checkJs 是否检查JS代码符合语法规范
"checkJs": false,
//removeComments 是否移除注释
"removeComments": false,
// 不生成编译后产生的JS文件
"noEmit": false,
//noEmitOnError 当有错误时不生成编译后文件
"noEmitOnError": false,
//alwaysStrict 用来设置编译后的文件是否使用严格模式
"alwaysStrict": false,
//noImplicitAny 不允许隐式的any类型
"noImplicitAny": false,
//noImplicitThis 不允许指向不明的this
"noImplicitThis": true,
// strictNullChecks严格检查空值
"strictNullChecks": false,
//strict 严格检查的总开关
"strict": false
}