问题1:tsx文件找不到

根目录新建一个tsconfig.json

{
  "compilerOptions": {
    "jsx": "react",
    "outDir": "./dist",
    "module": "es6",
    "target": "es5",
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "moduleResolution": "Node",
  }
}
问题二: styles找不到
import  styles  from  ‘./index.module.scss’   
在src目录下新建一个typings文件夹,(webpack5在根目录创建),新建index.d.ts,并将scss文件声明为模块
tsx 引入文件找不到

 

 

 

 

相关文章:

  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-03-31
  • 2021-04-01
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-22
  • 2021-11-18
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
相关资源
相似解决方案