Alfred-Skyblue / vue-draggable-plus

Universal Drag-and-Drop Component Supporting both Vue 3 and Vue 2
https://vue-draggable-plus.pages.dev/en/
MIT License
2.74k stars 106 forks source link

Fix TS typing for `"moduleResolution": "Bundler"` #28

Closed Heniker closed 1 year ago

Heniker commented 1 year ago

Currently trying to import anything from vue-draggable-plus in TS file with tsconfig { "compilerOptions": { "module": "ESNext", "moduleResolution": "Bundler", "strict": true } } results in TS error. This PR fixes provided typings by correctly setting "types" field in package.json.

For more info see this issue: https://github.com/microsoft/TypeScript/issues/52363 Also there is this nifty tool to check if types are correct: https://arethetypeswrong.github.io/?p=vue-draggable-plus

This is not a perfect fix, as "module": "Node16" still won't work, but fixing that would require reconsidering usage of UMD builds.