發佈一個Vuejs組件作爲包我創建(使用的WebPack)一vuejs2項目,2個分量,我想在NPM發佈這個項目作爲一個整體,這樣我可以使用這個項目與多個項目中的所有組件(可重用組件)。在NPM
我發表了關於故宮npm publish
該項目,並利用安裝NPM安裝my-components
包,我發現裏面的項目node_modules
但它是與整個源代碼,如果我複製/粘貼的項目存在。
還當我嘗試運行npm build dist
我得到一個錯誤:
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
在我的項目(https://github.com/Trelllis/my-components),有一個組件調用VUE的版本,我不能使用和項目我的 - 組件未解決。
我怎麼能與它的所有部件正確發佈這個項目?
感謝
看看這個類似的問題https://stackoverflow.com/questions/45298859/how-to-publish-a-library-of-vue-js-components/45299467#45299467 vue-share模板可以解決你的問題,它在那裏相連。 – Reiner