I created a vuejs2 project (using webpack) with 2 components, I want to publish this project on npm as a package so that I can use all the components inside this project with multiple projects (reusable components).
I published the project on npm npm publish
and installed the package using npm install my-components
, I found the project inside node_modules
but it was with the whole source code, as if I copy/pasted the project there.
Also when I try to run npm build dist
I am getting an error:
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dist"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! missing script: dist
npm ERR! npm ERR! If you need help, you may report this error at: npm ERR!
https://github.com/npm/npm/issuesnpm ERR! Please include the following file with any support request: npm ERR!
/Users/myuser/Documents/Projects/my-components/npm-debug.log
Inside my project (https://github.com/Trelllis/my-components), there is a component called vue-version which I can't use and the project my-components isn't resolved.
How can I publish this project properly with all its components?
Thanks