• VUE项目中的tsconfig.json详解


    vue项目中使用TypeScript时项目中会自动生成一个tsconfig.json文件

    tsconfig.json 是用于配置TypeScript 编译时的配置选项

    常用的配置如下:

    {
      "compilerOptions": {
        // 目标代码(ts -> js(es5/6/7))
        "target": "esnext",
        // 目标代码需要使用的模块化方案(commonjs require/module.exports/es module import/export)
        "module": "esnext",
        // 严格一些严格的检查(any)
        "strict": true,
        // 对jsx进行怎么样的处理
        "jsx": "preserve",
        // 辅助的导入功能
        "importHelpers": true,
        // 按照node的方式去解析模块 import "/index.node"
        "moduleResolution": "node",
        // 跳过一些库的类型检测 (axios -> 类型/ lodash -> @types/lodash / 其他的第三方)
        // import { Person } from 'axios'
        "skipLibCheck": true,
        // export default/module.exports = {}
        // es module 和 commonjs
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        // 要不要生成映射文件(ts -> js)
        "sourceMap": true,
        // 文件路径在解析时, 基本url
        "baseUrl": ".",
        // 指定具体要解析使用的类型
        "types": ["webpack-env"],
        // 路径解析(类似于webpack alias)
        "paths": {
          "@/*": ["src/*"],
          "components/*": ["src/components/*"]
        },
        // 可以指定在项目中可以使用哪里库的类型(Proxy/Window/Document)
        "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
      },
      "include": [
        "src/**/*.ts",
        "src/**/*.tsx",
        "src/**/*.vue",
        "tests/**/*.ts",
        "tests/**/*.tsx"
      ],
      "exclude": ["node_modules"]
    }
    
    
  • 相关阅读:
    docker简单介绍----Dockerfile命令
    docker简单介绍----docker仓库的应用
    nginx实现https的配置文件
    docker简单介绍---网络端口管理
    mysql查看实时连接数
    linux 批量测试域名返回码脚本
    docker简单介绍----镜像和容器管理
    香冢
    GitHub 在使用命令行 git push 时报错:The requested URL returned error: 403
    守规矩应该被骂吗?
  • 原文地址:https://www.cnblogs.com/qingheshiguang/p/15889743.html
Copyright © 2020-2023  润新知