vuejs2 - How to publish a vue js plugin that modifies an existing plugin -


i trying create plugin utilizes components vuejs plugin (vuetify). basically, have common components want share across multiple applications our company.

i thought matter of:

  1. create github repo shared components
  2. author plugin
  3. reference repo in consuming apps via npm install

here gist of plugin:

// src/index.js <-- package.json/main set "src" import mycomponent "./mycomponent.vue"; import * api "./api";  export default function install(vue) {     vue.component("mycomponent", mycomponent );     vue.prototype.$myapi = api; } 

at moment, behavior i'm seeing is:

good

  • plugin install function being executed
  • functions api attached vue.prototype available in app components
  • my-component available in app , renders markup

bad

  • $myapi , vuetify components not available in application instance of of my-component

if copy same files app , change import, works expected. so, wonder if i'm missing regarding sharing code via external modules.

i've tried these alternatives same issue:

  • use npm link link plugin module app
  • manually, use mklink (windows sym link) link plugin module node_modules in app folder
  • use long relative path reference plugin module: import myplugin "../../../my-plugin"


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -