为了将 React 库推送到 NPM,您可能需要一些样板文件来为您安装和转换许多东西。
=====
我还成功地将几个 React 库推送到 NPM 中:
https://www.npmjs.com/~thinhvo0108 https://www.npmjs.com/~thinhvo0108
https://www.npmjs.com/package/react-sticky-dynamic-header https://www.npmjs.com/package/react-sticky-dynamic-header
https://www.npmjs.com/package/react-ringing-bell https://www.npmjs.com/package/react-ringing-bell
=====
你的 github 存储库的文件夹结构也应该与我的类似:
https://github.com/thinhvo0108/react-sticky-dynamic-header https://github.com/thinhvo0108/react-sticky-dynamic-header
https://github.com/thinhvo0108/react-ringing-bell https://github.com/thinhvo0108/react-ringing-bell
=====
有用的教程如下:
(样板源)https://github.com/juliancwirko/react-npm-boilerplate https://github.com/juliancwirko/react-npm-boilerplate
(作者文章)http://julian.io/creating-react-npm-packages-with-es2015/ http://julian.io/creating-react-npm-packages-with-es2015/