We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当前测试不支持导出 declare module "xxx" 和 declare global , 而这两个也是拓展其他库常用定义,速度支持-_-
// 为vue库定义一个名为Test新类型 export declare module "vue"{ export type Test = { newField : string } }
通过vite build 编译后无法在构建产物 xxx.d.ts中找到上面定义,此时也是无法通过 import { Test } from 'vue' 引入拓展的新类型
.
No response
The text was updated successfully, but these errors were encountered:
这是一个 api-extractor 已知的问题:microsoft/rushstack#2090 microsoft/rushstack#1709
目前你可以参考 VueRouter 的做法 或暂时不使用 rollupTypes 功能。
rollupTypes
Sorry, something went wrong.
我现在使用了vue-router的做法,但是该做法不够优雅,因为必须准确控制文本切割合并的行数。 后面发现了有这么个仓库,看下可以给您参考下,将其外部配置字符串指向的文件 解析成ast语法树,之后再输出(feature: 给出一个配置合并到同一个文件或者全局定义的d.ts单独输出一个文件 ) 您可以考虑后面加上该功能,我觉得手动解析的话可能是当前的最佳实践,也能使vite-plugin-dts更加完美 rollup-plugin-add-global-ts
我花了点时间写了解决这个问题的通用插件 vite-plugin-copy-dts
39606bd
No branches or pull requests
Description
当前测试不支持导出 declare module "xxx" 和 declare global , 而这两个也是拓展其他库常用定义,速度支持-_-
测试导出代码
遇到的情况
通过vite build 编译后无法在构建产物 xxx.d.ts中找到上面定义,此时也是无法通过 import { Test } from 'vue' 引入拓展的新类型
Suggested solution
.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: