vue-global-type-gen

1.1.0 • Public • Published

Vue Global Type Generator

generate global vue components types.
ex.)

declare module '@vue/runtime-core' {
  export interface GlobalComponents {
    TextBtn: typeof import('example/components/TextBtn.vue').default
    LazyTextBtn: typeof import('example/components/TextBtn.vue').default
  }
}

Usage

installation

$ npm install -D vue-global-type-gen
# or
$ yarn add -D vue-global-type-gen
# or
$ pnpm install -D vue-global-type-gen

configure your npm scripts

{
  "scripts": {
    "vue-global-type-gen": "vue-global-type-gen"
  }
}

CLI Options

option default description
--config, -c vue-gt.yml your config yml path
--version, -v - print version

Configuration

setting vue-gt.yml

# vue-gt.yml
# default
config:
  out: auto-import.d.ts
  includes: [components/**/*.vue, pages/**/*.vue]
  excludes: [node_modules]
  stdout: false # when true, print type definition to std out
  lazyComponents: true # when true, generate prefix 'Lazy' component

/vue-global-type-gen/

    Package Sidebar

    Install

    npm i vue-global-type-gen

    Weekly Downloads

    1

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    244 kB

    Total Files

    6

    Last publish

    Collaborators

    • ubugeeei