配置 ts-loader 后 执行编译时报错 TS6142: Module './router' was resolved to 'C:\GitHubWorkspace\webpackPluginDemo\src\router.tsx', but '--jsx' is not set.

这时候 需要在tsconfig.json中添加一条

"jsx": "react"

{
    "compilerOptions": {
      "jsx": "react",
      "target": "es5",
      "sourceMap": true
    },
    "exclude": [
      "node_modules"
    ]
  }

  

posted @ 2020-08-06 14:28  飞尽堂前燕  阅读(3560)  评论(0编辑  收藏  举报