TypeScript - 配置文件 tsconfig.json
tsconfig.json 文件
tsconfig.json 文件创建两种方式:
1. 直接在根目录新建tsconfig.config.json (配置文件需要自己配置)
2. 执行tsc --init (会自动创建相关配置)
tsc --init
{
"compilerOptions": {
// target 用来指定ts被编译为的ES版本
// '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'esnext'.
"target": "ES6",
// 指定要使用的模块化的规范
// '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'esnext'.
"module": "System",
// library 用来指定项目中要使用的库
// 代码提示
// '--lib' option must be: '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', 'es202.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": ['dom']
// outDir 用来指定编译后文件所在的目录
"outDir": "./dist",
// outFile 将代码合并为一个文件
// 设置outFile后,所有全局作用域中的代码 会合并到同一个文件, 但是如果文件中有模块引用,则module需要改为System
// 该功能一般是打包工具来做,仅作了解,
"outFile": "./dist/app.js",
// 是否编辑js文件, 默认false
"allowJs": true,
// 是否检查js代码是否符合语法规范
// js中, let a = 10; a = 'hello'; true的情况下,会变检查
"checkJs": true,
// 是否移除注释
"removeComments": true,
// 不生成编译后的文件 即dist内的东西
"noEmit": false,
// 当有错误的时候,是否生成编译文件,避免编译错误代码
"noEmitOnError": true,
// 语法检查相关属性
// 所有严格检查的总开关, 下面的一些是否启动,即使后面的是true, 如果此处是false,同样不执行
"strict": true,
// 用来设置编译后的文件是否启用严格模式,默认false
"alwaysStrict": true,
// 否否允许隐式的any类型
// function sum(a, b){ return a + b } 此处a b就是隐式的any
"noImplicitAny": true,
//不允许不明确类型的this
// function a(){ console.log(this) }
"noImplicitThis": true,
// 是否检测null值
"strictNullChecks": true
}
}
TypeScript - 配置文件 tsconfig.json的更多相关文章
- TypeScript的配置文件 tsconfig.json
//tsconfig.json指定了用来编译这个项目的根文件和编译选项 { "compilerOptions": { //compilerOptions:编译选项,可以被忽略,这时 ...
- TypeScript 之 tsconfig.json
https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/tsconfig.json.html 如果一个目录下存在一个tsco ...
- TypeScript编译tsconfig.json配置
配置预览 { "include": ["src/**/*"], "exclude": ["ndoe_modules", ...
- TypeScript tsconfig.json(TypeScript配置)
如果一个目录下存在一个tsconfig.json文件,那么意味着这个目录是TypeScript项目的根目录. tsconfig.json文件中指定了用来编译这个项目的根文件和编译选项. 一个项目可以通 ...
- tsconfig.json配置
什么工具看什么官网-一般都会有说明的 https://www.tslang.cn/docs/handbook/tsconfig-json.html 概述 如果一个目录下存在一个tsconfig.jso ...
- tsconfig.json
概述 如果一个目录下存在一个tsconfig.json文件,那么它意味着这个目录是TypeScript项目的根目录. tsconfig.json文件中指定了用来编译这个项目的根文件和编译选项. 一个项 ...
- nwjs 配置文件package.json 转载
配置文件package.json nw在启动应用程序时,首先要读取package.json文件,初始化基本属性,下面我们看看package.json的完整参数.每个参数配置都标有注释. { /**指定 ...
- [TypeScript] TypeScript对象转JSON字符串范例
[TypeScript] TypeScript对象转JSON字符串范例 Playground http://tinyurl.com/njbrnrv Samples class DataTable { ...
- 循序渐进学.Net Core Web Api开发系列【6】:配置文件appsettings.json
系列目录 循序渐进学.Net Core Web Api开发系列目录 本系列涉及到的源码下载地址:https://github.com/seabluescn/Blog_WebApi 一.本篇概述 本篇描 ...
- The "tsconfig.json" file must have compilerOptions.sourceMap set to true
在编译ionic项目的时候出现:Error:The "tsconfig.json" file must have compilerOptions.sourceMap set to ...
随机推荐
- redis sentinel 部署
redis sentinel 部署 服务器说明 192.168.2.200 master redis-server redis-sentinel 192.168.2.201 slave1 redis- ...
- winform 子控件触发父控件事件
private void circlePanel_Click(object sender, EventArgs e) { var panel=sender as UIPanel; if (panel. ...
- python web自动化-文件上传-亲身实践
文件上传三种方式: (一)查看元素标签,如果是input,则可以参照文本框输入的形式进行文件上传 方法:和用户输入是一样的,使用send_keys 步骤:1.找到定位元素,2,输入文件路径 ele=d ...
- HANDLE和HMOUDLE、HWND讲解
HWND是线程相关的,通常指明窗口句柄,通过句柄找到窗口所属进程和线程 Handle 是代表系统的内核对象,如文件句柄,线程句柄,进程句柄.系统对内核对象以链表的形式进行管理,载入到内存中的每一个内核 ...
- 1. ansible学习总结: 基础模块
copy模块: #传输文件到目标机 ansible -i /kingdee/ansible/host all -m copy -a 'src=/tmp/aaaa.tgz dest=/tmp/aaaa. ...
- robots.txt 文件说明
robots其实就是指Robots协议,Robots协议(也称为爬虫协议.机器人协议等)的全称是"网络爬虫排除标准"(Robots Exclusion Protocol),网站通过 ...
- (0807) import 与 include文件
1)验证中filelist以及package https://blog.csdn.net/geter_CS/article/details/125689476 总结来说:规则是,要想使用某个文件内容, ...
- 问题记录_IDEA版本2021.2.3_debug时变量显示不全(只显示线程附近部分)
问题记录_IDEA版本2021.2.3_debug时变量显示不全(只显示线程附近部分) 起因 把IDEA的版本从2019升级到了2021.2.3,在debug的时候发现变量的值能看到的很少,并不像20 ...
- django 关联类 DoesNotExist: User matching query does not exist.
问题就是 关联类为空找不到 在或者geattr / hasattr / obj. item 会抛出异常 无法通过判断处理 捕获异常 try: tmp_data['demand_dept_name'] ...
- python peewee
from peewee import MySQLDatabase, Model from peewee import CharField, IntegerField, BooleanField # 引 ...