How to set up a private shared library of React components with Webpack

ぃ、小莉子 提交于 2019-12-05 23:12:01

I wish I could find a more elegant solution, but adding this to my webpack.config.js worked:

resolve: {
    fallback: path.resolve(__dirname, 'node_modules')
},
resolveLoader: { root: path.join(__dirname, "node_modules") },

However, I ultimately decided it would be easier just to share the components between projects in a git submodule.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!