vuejs / vue-cli-plugin-vue-next

A Vue CLI plugin for trying out vue-next (experimental)
MIT License
339 stars 23 forks source link

TypeScript support #7

Open cexbrayat opened 4 years ago

cexbrayat commented 4 years ago

Thank you for making this plugin.

It is currently usable with the TypeScript CLI plugin, but requires a few changes in the generated project:

npx @vue/cli create vtc-repro --inlinePreset '{"plugins": {"@vue/cli-plugin-typescript": {"classComponent": false},"vue-cli-plugin-vue-next": {}}}'

The changes needed are in this commit.

Here is a list:

Is it something that the plugin could handle? Or do you have in mind to create another plugin for the TS version?

ishitatsuyuki commented 4 years ago

Shims are required for routers. A working version can be copied from https://github.com/vuejs/vue-router-next/blob/master/playground/shim.d.ts

cexbrayat commented 4 years ago

@ishitatsuyuki I'm not sure you need the shims. I have a project with Vue 3.0.0-alpha.12, Vue Router 4.0.0-alpha.5, using TypeScript and the Vue CLI, and I don't need them.

ishitatsuyuki commented 4 years ago

Okay, “required” might have been vague here. The shims are needed for code assistance, otherwise Visual Studio Code will give red lines for component imports.

webpack build will complete without them.