You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @beliefgp. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to main branch, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!
你好 @beliefgp,我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到 main 分支,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待你的贡献。
Activity
github-actions commentedon Jun 16, 2024
Hello @beliefgp. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to
mainbranch, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!你好 @beliefgp,我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到
main分支,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待你的贡献。fix(cli): fix .vue import paths broken during type declaration build
gril520 commentedon Oct 16, 2026
你好 #13942 该提交对编译时机进行了修改 ,具体如下:
问题
Closes #12912
在 ts + .vue 模式下开发组件时,vant-cli build 会因为执行顺序问题导致 TS 编译失败。
原因分析
buildTypeDeclarations() 的执行流程:
preCompileDir() → .vue 编译为 .ts/.jsfixVueImportExtensions() → 修复脚本文件中 .vue 的 import 后缀(新增)
tsc → 正确解析 import 路径
fixVueImportExtensions() 会递归扫描目录中的脚本文件,将引号内的 .vue 路径替换为实际编译后的扩展名(.ts 或 .js),确保 tsc 能正确解析模块。
改动文件
packages/vant-cli/src/commands/build.ts - 新增 fixVueImportExtensions() 函数 - 在 buildTypeDeclarations() 中调用,位于 preCompileDir 与 tsc 之间