You can have a private repository in you package.json
So the library with .vue components
{
"name": "my-package-with-components",
"version": "1.0.0",
"files": [
"lib/js/components/**.vue"
]
}
In the project where you want to use those components
{
"devDependencies": {
"my-package-with-components": "git+ssh://git@my/repo.git#master",
}
}
In you application script you can import the .vue files
import SpecialComponent1 from 'my-package-with-components/lib/js/components/SpecialComponent1.vue';
import SpecialComponent2 from 'my-package-with-components/lib/js/components/SpecialComponent2.vue';
Vue.component('special-component-1', SpecialComponent1);
Vue.component('special-component-2', SpecialComponent2);
You can load a library in NPM from a directory with npm link
cd mylib/ && npm link
cd ../myapp && npm link mylib