vuejs / create-vue

🛠️ The recommended way to start a Vite-powered Vue project
Other
3.82k stars 434 forks source link

Scaffolding for a vue plugin on npm #565

Open luckydonald opened 2 months ago

luckydonald commented 2 months ago

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.

luckydonald commented 2 months ago

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.

Yordan-Ramchev commented 2 months ago

@luckydonald You need Vite to create a bundle, here is a link https://vitejs.dev/guide/build.html#library-mode