123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- {
- // 编译全部ts文件:tsc
- // 自动编译全部ts文件:tsc -w
- // 包含
- // "include": [
- // ** 任意文件目录
- // * 任意文件
- // "./src/**/*"
- // ],
- // 排除
- // "exclude": [
- // "./src/**/*"
- // ],
- // "extends" 继承
- // files 文件
- // 编辑选项
- "compilerOptions": {
- // 模板 => Node
- "moduleResolution": "Node",
- // target规定了 ts编译成那个js的版本:'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'
- "target": "ES2015",
- // 模块 "CommonJS", "AMD", "System", "UMD", "ES6", "ES2015", "ES2020", "ESNext", "None", "ES2022", "Node16", "NodeNext", "Preserve".
- "module": "system",
- // lib 规定允许使用什么库
- "lib": ["dom"],
- // outDir 规定将编译后的文件具体放在那个位置
- "outDir": "./dist",
- // outFile 将编译后的所有文件放在一个文件夹下
- "outFile": "./dist/hello.js",
- //allowJs 允许编译js文件
- "allowJs": true,
- // checkJs 檢查js文件是否符合编译规范
- "checkJs": true,
- // removeComments 是否移除注释
- "removeComments": true,
- // noEmitOnError 规定错误是否允许编译
- // "noEmitOnError": true,
- // noEmit 规定文件是否被编译
- // "noEmit": true
- // 是否开启严格模式
- "strict": false
- // alwaysStrict 编译后的文件是否按照严格模式执行
- // "alwaysStrict": false,
- // // 不允许数据默认是any类型
- // "noImplicitAny": true,
- // // 规定是否允许使用this
- // "noImplicitThis": true,
- // // 检查是否为空
- // "strictNullChecks": true
- }
- }
|