TypeScript declaration file that allows using
*.vue files. The primary use case is a bundler environment like Browserify with vueify. The file itself consists of 5 lines; this package is just for convenience.
There are two current versions: version 2.x for a CommonJS environment, e.g., Browserify/vueify and version 3.x for an ES6 environment that uses
This package requires TypeScript 2 and Vue.js 2, which ships with new type definitions in the Vue.js package itself. Both must be installed separately in your project, which allows choosing a suitable version.
npm install vue-typescript-import-dts --save-dev
npm install vue-typescript-import-dts@2 --save-dev
Import (one of):
typesfield of your
tsconfig.jsonto globally allow using import with
.vuefiles in your project:
Then, it is possible to
import Child from './child.vue'
import Child = require('./child.vue')
import * as Child from './child.vue'
Note: TypeScript will not type check, parse, or even verify the existence of the
.vue file: this project only instructs the TypeScript compiler to assume the import of 'something' that ends with
.vue succeeds and is a
If you are using TypeScript 2 together with Vue.js 2, you might also be interested in