How to develop a Vue plug-in in NPM

I created a "plug-in" myself through the plug-in registration method provided by Vue. After a long period of robust testing, I want to transfer it out to generate a separate Vue plug-in and publish it on npm. The previous project used vue cli.

how should I configure webpack now to make my Vue plug-in work?
is there a similar cli that makes it easier for me to create vue plug-ins?

< hr >

Update

if you want to package the vue plug-in into a npm package
, you need to write some webpack rules separately and eventually generate a xxx.js xxx.css file to provide to the user.

Mar.13,2021

vue plug-in or webpack plug-in? The
vue plug-in can directly export your code. Then use the local import+Vue.use (plug-in) to


refer to the process of publishing the npm package
and the Chestnut


you can refer to vue-router , and then npm publish

.

then you can npm install your plugin

execute Vue.use () in main.js

= update =
are you asking how to package each module into a js file and a css file?

Menu