vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

Can not emit declaration files for TypeScript #1081

Open duduluu opened 6 years ago

duduluu commented 6 years ago

Version

3.0.0-beta.6

Reproduction link

https://github.com/HuijiFE/void-ui/tree/0.1

Steps to reproduce

git clone git@github.com:HuijiFE/void-ui.git
cd void-ui
git checkout 0.1
yarn
yarn build:void

What is expected?

Output declaration files after building.

What is actually happening?

There is not any declaration files after building.


I have set "declaration": true, in tsconfig.json, but it doesn't output the typescript declaration files.

And then I use tsc --emitDeclarationOnly, although it output the declaration files but without vue single file component.

Belphemur commented 2 years ago

With VueJS 3 you can use vue-tsc --declaration --emitDeclarationOnly when you add the package vue-tsc

https://github.com/johnsoncodehk/volar/tree/master/packages/vue-tsc

This will generate the declaration file where you have set your outDir in tsconfig.json

seamory commented 9 months ago

In 2024, this problem is still alive. Too terrible.

bodograumann commented 9 months ago

I thought vue-cli was deprecated anyway, so it should come as no suprise that no more development is going on.

johnnyshankman commented 9 months ago

Yeah you're better off swapping to vite @seamory @bodograumann, vue cli is dead.