react ts 设置paths 和 声明非@types的模块

step1.

   在根目录下创建paths.json 

  

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"]
    }
  }
}

step2.

  在tsconfig.json 中加上 

   

  "extends": "./paths.json"

 

step3.
 新建declaration.d.ts
declare module 'xxxxx';

   

  
posted @ 2021-11-16 16:42  monica_guorong  阅读(275)  评论(0编辑  收藏  举报