解决create-react-app 集成ts 报error :because it would overwrite input file. TS5055 问题

下面这一堆的bug你喜欢吗?我气炸了已经。
在这里插入图片描述
具体解决方案:
如下是我的tsconfig.json 文件 由于刚开始的时候没有加outDir所以导致了TS5055错误 加上之后就好了,但是需要注意填写的值,在react的这个脚手架中上线目录文件名为:build 所以写"./build" ,平时项目中一般都喜欢写"./dist" 这个需要自行去webpackconfig.js中更改了。

{
    "compilerOptions": {
        //"outDir": "./build",  // 需要加上
        "module": "commonjs",
        "noImplicitAny": false,
        "removeComments": true,
        "preserveConstEnums": true,
        "target": "es5",
        "lib": ["es6", "dom"],
        "sourceMap": true,
        "allowJs": true,
        "jsx": "react",
        "moduleResolution": "node",
        "rootDir": "src",
        "noImplicitReturns": true,
        "noImplicitThis": true,
        "strictNullChecks": true,
        "esModuleInterop": true
    },
    "include": [
        "src"
    ],
    "exclude": [
        "node_modules",
        "config",
        "scripts",
        "public"
    ]
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值