Vue-cli: Plugin Support for new cli

Created on 15 Feb 2018  路  7Comments  路  Source: vuejs/vue-cli

What problem does this feature solve?

Allows user to scaffold a new plugin using the new cli.

### What does the proposed API look like?
-

Most helpful comment

You mean a Vue plugin or a CLI plugin?

If it's a Vue plugin you can simply use vue-cli-service build --target lib src/main.js

All 7 comments

The simplest plugin just need a package.json and index.js. There's really no need for scaffolding.

The main reason i ask is that i wouldve like typescript for it as well as all the other boilerplate you get with the current cli. (i.e unit test, e2e test etc)

You mean a Vue plugin or a CLI plugin?

If it's a Vue plugin you can simply use vue-cli-service build --target lib src/main.js

Yeah i mean a vue plugin. I dont understand what you mean though

would this be set as main in the package.json file 'dist{{my-project-name}}.umd.min.js '

This should be in the doc, somewhere, because I wasn't sure it could be done.
--target should be detailed at least.
What does "lib" does differently from "app" ?
Thanks

I found some docs on it @ https://github.com/vuejs/vue-cli/blob/dev/docs/build-targets.md

In general, I think building a lib should be more documented. I've been spending too much time now looking the "best" way to start building my own lib. Many of the boilerplate templates and examples out there are massive! After a lot of trial and error, it was vue-cli and changing setting the build-target that did everything I needed..

Was this page helpful?
0 / 5 - 0 ratings