Open HUST-SE-LY opened 2 weeks ago
@2heal1 do you have any idea here why it is not detected?
Hello,
i have a similar issue by using module federation quick start rsbuild example converted to vue3
let me check this
as mentioned in issue 2685 HUST-SE-LY's comment , it works with latest vue-tsc 1.x (1.8.27). Regarding rsbuild, it doesn't provide vue-tsc by default for vue3 typescript projects as it uses tsc directly to build. So, it would be nice to get the types generated with tsc directly.
I find vue-tsc@1.7.0 will not use writeFile
anymore , so this is the reason why our logic not work .
And the vue-tsc@<1.7.0 also has some questions , as @WeetA34 say , i will try tsc instead to see if it can work
I check again and find it can not use tsc to compile .vue file .
I will fix the issue by re-implement the ts compile.
Describe the bug
The bug happened when I use webpack with module federation 2.0 to build my Vue App. When I run
pnpm start
incontainer
folder, A type declaration file is missing from @mf-types.zip in the dist directory.Then I read the source code, I find in
packages/dts-plugin/src/core/lib/typeScriptCompiler.ts
, functioncreateHost
rewrites thewriteFile
oftypescript
,but this looks useless under vue-tsc. Whether it is a component or a function, the following code doesn't seem to execute, and the target.d.ts
file cannot be generated. By the way, in vue-tsc,sourceFile.fileName
seems to beApp.vue.ts
, notApp.vue
, so the following code may be wrong.Reproduction
https://github.com/HUST-SE-LY/mf-vue3-demo
Used Package Manager
pnpm
System Info
Validations