I'm having trouble creating a definition file for vue-moment. While it compiles perfectly in IntelliJ, I encounter an issue with vue-cli build:
This dependency was not found:
* vue-moment in ./src/main.ts
In my package.json, I added:
"types": "types/index.d.ts",
Inside main.ts:
import VueMoment from 'vue-moment';
Vue.use(VueMoment);
In index.d.ts:
import Vue, {PluginFunction} from 'vue';
import moment from 'moment';
export interface VueMoment {
install: PluginFunction<never>;
}
declare const VueMoment: VueMoment;
export default VueMoment;
declare module 'vue/types/vue' {
interface Vue {
readonly $moment: typeof moment;
}
}
Seems simple enough, and the same approach works for many other libraries.
The package is installed and located within node_modules.
I am completely stuck here and really need a hint on where I made an error. Thank you in advance for any help provided.