TS配置文件tsconfig.json详细配置

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
	}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

源刃

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值