Next.js, TypeScript 和 tsconfig.json 'jsx' 属性被覆盖。

问题描述 投票:0回答:1

如何停止 jsx 当运行开发服务器时,NextJS将'react'属性覆盖为'preservation'?

我的 tsconfig.json 文件。

  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve"
  },
  "exclude": [
    "node_modules"
  ],
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx"
  ]
}

AFAIK的jsx选项必须是: react 编制我的 tsx 文件到 jsx.

reactjs typescript next.js tsconfig
1个回答
0
投票

在这里回答。

https:/github.comkulshekharts-jestissues937

本质上,你延长了当前的 tsconfig.json 戏称一下 tsconfig.json 从你 jest.config.js.

© www.soinside.com 2019 - 2024. All rights reserved.