2.5.3
https://github.com/gluons/vue-issue-6999
Vue
or typeof Vue
types.compilerOptions
-> declaration
to true
Able to build without error.
It should be able to export plugin/library with TypeScript declaration.
Default export of the module has or is using private name 'VueConstructor'
happened when built it.
I'm developing Vue component with TypeScript.
I also need TypeScript to generate declaration for other TypeScript developer (And also JavaScript with Vetur 🙂).
But I face this error. 😢
I've made a PR to expose VueConstructor
#7002
In the meantime, you can manually annotate the install
function by PluginFunction
export default {
install: install as PluginFunction<void>
}
Version
2.5.13
I try [email protected], when set compilerOptions.declaration = true
in tsconfig.json
,it export error
Default export of the module has or is using private name 'VueConstructor'.
@relign Try importing VueConstructor
above your code.
import { VueConstructor } from 'vue';
/* or */
import Vue, { VueConstructor } from 'vue'; // With Vue
I've opened a request to fix issues like these in TypeScript by bringing declaration files to parity with language features. https://github.com/microsoft/TypeScript/issues/35822
Most helpful comment
@relign Try importing
VueConstructor
above your code.