tsconfig.json

{   "compilerOptions": {     "target": "es5",//编译后的目标     "lib": [       "dom", //dom运行环境       "dom.iterable",//迭代器运行环境       "esnext"//es6转化成es5的环境     ],     "downlevelIteration": true,     "allowJs": true, //是否允许在ts文件中引入js     "skipLibCheck": true,//是否跳过声明文件的检查     "esModuleInterop": true, //可以使用es6的方式导入node.js的方法     "allowSyntheticDefaultImports": true,     "strict": true,//所有的语法都会进行严格的检查     "forceConsistentCasingInFileNames": true,//文件名是否区分大小写     "module": "esnext",//模块化标准     "moduleResolution": "node",//按照node的规则去找文件     "resolveJsonModule": true,//是否允许把json文件当做模块进行解析     "isolatedModules": true,//每个文件需要是一个模块     "noEmit": true, //不需要生成文件     "jsx": "react"   },   "include": [     "src" //处理src目录下的文件   ] }

相关文章