docs icon indicating copy to clipboard operation
docs copied to clipboard

Add an updated 'Packaging Vue Components for npm' cookbook entry

Open kytta opened this issue 2 years ago • 1 comments

In v2 Docs, there was a very nice Cookbook recipe about how to publish a Vue component to NPM. It is based on Rollup and is really outdated; at the time of its writing, Vue CLI 3 was in beta.

There was an attempt at this in #664, yet it's almost been 2.5 years since then, and there wasn't an issue asking for this, so I imagine this was eventually forgotten.

Things that I would change/mention:

  • usage of a Vite-based config instead of Rollup/Vue CLI
  • remove auto-install instructions since there's no global Vue object any more
  • perhaps stop offering Babel/Buble transpilation? I think Vite/esbuild can handle it at this point

vue-sfc-rollup (mentioned in the v2 Cookbook) did provide a good template for a shareable SFC, but it doesn't use Vite and has been deprecated since then.

kytta avatar Mar 09 '23 20:03 kytta

Oh, and another question I had: If the page gets updated, where does one put it in the docs? V3 docs don't seem to have a Cookbook section

kytta avatar Mar 10 '23 10:03 kytta