问题
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"
},