[英]Create-react-app as a dependency, similar to storybook
I am working on several React projects and would like to create a shared dependency that would display their React components in isolation, similar to Storybook. 我正在研究多个React项目,并希望创建一个共享的依赖项,以独立显示其React组件,类似于Storybook。
I would like: 我想要:
I've tried ejecting and changing the weback config file (removing the module scope plugin) and adding a loader that would compile files from two or three folders above, but I always get the same error: 我试过弹出并更改weback配置文件(删除模块作用域插件),并添加了一个加载器,该加载器将编译上面两个或三个文件夹中的文件,但是我总是遇到相同的错误:
You attempted to import ... which falls outside of the project src/ directory.
Is there an easy way to enable compiling outside of src? 有没有一种简单的方法可以在src之外进行编译?
My company has used Lerna to create a Monorepo. 我的公司使用Lerna来创建Monorepo。 Our use case was almost identical to yours, if I'm understanding yours correctly.
如果我正确理解了您的用例,那么我们的用例几乎与您的用例相同。
Setting up Lerna wasn't super easy at first. 最初,设置Lerna并非易事。 We used a Yeoman generator to scaffold it, I think (but we might have ended up doing it manually in the end; I don't remember.)
我认为,我们使用了Yeoman生成器对其进行了脚手架(但是最终我们可能最终不得不手动完成它;我不记得了。)
I found this article talking about some of this stuff. 我发现本文谈论的是其中一些内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.