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

step1.

   在根目录下创建paths.json 

  

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

step2.

  在tsconfig.json 中加上 

   

  "extends": "./paths.json"
step3.
 新建declaration.d.ts
declare module 'xxxxx';

   

  
原文地址:https://www.cnblogs.com/cylblogs/p/15561999.html