Skip to content
New issue

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

expose类型生成,是否能支持.vue文件 #303

Closed
Qeney opened this issue Aug 29, 2022 · 5 comments
Closed

expose类型生成,是否能支持.vue文件 #303

Qeney opened this issue Aug 29, 2022 · 5 comments

Comments

@Qeney
Copy link

Qeney commented Aug 29, 2022

empShare: {
name: 'microApp',
exposes: {
'./App1': './src/App1.vue',
'./App2': './src/App2.tsx',
},
}

上面这种配置,如果emp build后,自动生成的d.ts文件,只包含ts和tsx对应文件的导出类型,不包含.vue文件导出类型。

看了下源码实现部分,正则在匹配路径只匹配了'**/*.(ts|tsx)',导致.vue文件无法导出类型。

具体实现可参考:https://github.com/element-plus/element-plus/blob/dev/internal/build/src/tasks/types-definitions.ts

@ckken
Copy link
Contributor

ckken commented Aug 29, 2022

@ckken ckken closed this as completed Aug 29, 2022
@Qeney
Copy link
Author

Qeney commented Aug 29, 2022

image
image
image

尝试改成小写,生成的d.ts依然没有对应的类型

@Qeney
Copy link
Author

Qeney commented Aug 29, 2022

.vue文件模块是可以正常导出的,这个没问题

但是没有生成对应的模块d.ts类型声明

@ckken
Copy link
Contributor

ckken commented Aug 29, 2022

vue ts 要观察下

@ckken ckken reopened this Aug 29, 2022
@ckken
Copy link
Contributor

ckken commented Sep 2, 2022

这个应该是 vue3的项目吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants