参考链接 https://zhuanlan.zhihu.com/p/285270177
{ "compilerOptions": { "baseUrl": ".", // // 解析非相对模块的基地址,默认是当前目录 "target": "esnext", // 目标语言的版本 "module": "esnext", // 指定生成代码的模板标准 "strict": true, "jsx": "preserve", "importHelpers": true, "moduleResolution": "node", "skipLibCheck": true, // 开启null、undefined检测 "esModuleInterop": true, "allowSyntheticDefaultImports": true, "sourceMap": true, // 生成目标文件的soureceMap文件 "noImplicitAny": true, // 不允许隐式的 any 类型 "removeComments": true, // 删除注释 "jsx": "preserve", // 启用jsx "files": ['./scc/index.ts'], // 指定待编译文件,files 配置项值是一个数组,用来指定了待编译文件,即入口文件。 "types": [ "webpack-env", ], "paths": { // 路径映射,相对于baseUrl "@/*": ["src/*"], "@c/*": ["src/components/*"], "@u/*": ["src/utils/*"], }, "lib": [ "esnext", "dom", "dom.iterable", "scripthost" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx", ], "exclude": [ "node_modules" ]}
types 在vite 中
- “types”: [“vite/client”, “naive-ui/volar”]