项目打包提示一堆 ts 类型错误问题解决

问题

vue3 + ts 项目在打包的过程中报了一大堆 ts 类型错误提示,如下图所示:

在这里插入图片描述

报错:Could not find a declaration file for module … implicitly has an ‘any’ type.

解决方法

查看 package.json 文件,可以看到,默认 build 是会对 ts 代码进行检查的

在这里插入图片描述

我们只需要将 ts 代码检测配置去掉即可,去掉后代码:

"scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },

猜你喜欢

转载自blog.csdn.net/jiangjunyuan168/article/details/136269532