rollup-plugin-vue icon indicating copy to clipboard operation
rollup-plugin-vue copied to clipboard

Build a component that uses a child component method

Open gwen1230 opened this issue 5 years ago • 2 comments

Version

5.0.0

Reproduction link

https://github.com/gwen1230/test-lib

Steps to reproduce

Run : yarn build

What is expected?

Correctly build App.vue

What is actually happening?

When i executed rollup -c i have this error : [!] (plugin rpt2) Error: C:/Users/gleneindre/Documents/Projets/test/test-lib/src/App.vue?rollup-plugin-vue=script.ts(16,40): semantic error TS2339: Property 'print' does not exist on type 'Vue'.


I think it's because i have this shim-vue.d.ts :

declare module '*.vue' {
  import Vue from 'vue';
  export default Vue;
}

So I don't know how to build a project like this without cast components to any...

gwen1230 avatar Mar 25 '20 08:03 gwen1230

If i create a TestComponent.vue.d.ts next to TestComponent.vue, it works... But i don't know how to create this file during build and remove it after

gwen1230 avatar Mar 25 '20 08:03 gwen1230

Using useTsconfigDeclarationDir: true in your typescript plugin should make the job.

lrembacz avatar Jun 06 '20 11:06 lrembacz