Scaffolding for a vue plugin on npm
Please describe
Currently it's unclear how to setup and configure a repo to write a plugin for vue, i.e. a custom component to import from npm
Additional context
It would be great to have a generator for that, i.e. with
npm create vue@latest --plugin
or similar.
I've seen https://vuejs.org/guide/reusability/plugins.html, but this is not covering how to have that plugin prepared to be a standalone (external) file (package.json, etc.), only the vue file(s) itself.
@luckydonald You need Vite to create a bundle, here is a link https://vitejs.dev/guide/build.html#library-mode
I've made a tool similar to create-vue, but aimed at scaffolding Vue-based libraries:
pnpm create @skirtle/vue-lib
- Docs: https://skirtles-code.github.io/create-vue-lib/
- GitHub repo: https://github.com/skirtles-code/create-vue-lib/
It's likely there are still some important things I've missed, but it should be a lot better than starting from nothing.
I understand that an unofficial tool can't fully satisfy the same needs as an official solution, but if it proves popular then maybe it can act as a starting point for something official further down the line.