51 lines
1.7 KiB
JSON
51 lines
1.7 KiB
JSON
{
|
||
// compilerOptions编译器的选项
|
||
"compilerOptions": {
|
||
"moduleResolution": "node",
|
||
// target 用来指定ts被编译为ES的版本,默认是ES3
|
||
// 可以是 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017','es2018','es2019','es2020','esnext'.
|
||
"target": "ES6",
|
||
// module 指定要使用的模块化的规范
|
||
"module": "ESNext",
|
||
// outDir 用来指定编译后文件所在的目录
|
||
"outDir": "./js",
|
||
// 将代码合并为一个文件
|
||
// "outFile": "./js/index.js",
|
||
// 是否对js文件进行编译,默认是false
|
||
"allowJs": false,
|
||
// 是否检查js代码是否符合语法规范,默认是false
|
||
"checkJs": false,
|
||
// 是否移除注释
|
||
"removeComments": true,
|
||
// 不生成编译后的文件
|
||
"noEmit": false,
|
||
// 当有错误时不生成编译文件
|
||
"noEmitOnError": false,
|
||
// 所有严格检查的总开关
|
||
"strict": false,
|
||
// 用来设置编译后的文件是否使用严格模式,默认false
|
||
"alwaysStrict": false,
|
||
// 不允许隐式的any类型
|
||
"noImplicitAny": false,
|
||
// 不允许不明确类型的this
|
||
"noImplicitThis": false,
|
||
// 严格的检查空值
|
||
"strictNullChecks": false,
|
||
},
|
||
/**
|
||
"include" 用来指定哪些ts文件需要被编译
|
||
路径:**表示任意目录
|
||
* 表示任意文件
|
||
*/
|
||
"include": [
|
||
"./**/*" //代表编译包含src目录下的任意目录的任意文件,其余的不编译
|
||
],
|
||
/**
|
||
"exclude" 用来排除哪些ts文件需要被编译
|
||
默认值:[“node modues”、“bower_components”和Sspm_packages”]
|
||
*/
|
||
// exclude该选项一般不设置,用不到
|
||
"exclude": [
|
||
"./test/**/*" //不编译test下的所有文件
|
||
]
|
||
} |