[英]How can I embed small gatsby app into a CRA App
I have 2 applications - one written with CRA and one written with Gatsby.我有 2 个应用程序 - 一个用 CRA 编写,一个用 Gatsby 编写。 I would like to import the gatsby application into the CRA application.
我想将 gatsby 应用程序导入 CRA 应用程序。 I managed to do it with an iframe, but it is not a solution that satisfies me.
我设法用 iframe 做到了,但这不是一个让我满意的解决方案。 Is it possible to load a Gatsby application using the script tag?
是否可以使用脚本标签加载 Gatsby 应用程序? I think it might be difficult because I can see that after building a gatsby application, there are a lot of files in the public directory, and from what I know, it is impossible to create one output file.
我认为这可能很难,因为我可以看到构建一个 gatsby 应用程序后,公共目录中有很多文件,据我所知,不可能创建一个 output 文件。
I would like to import it like this我想像这样导入它
<script src="path/to/gatsby" />
Do you think it is possible at all?你认为有可能吗? Has anyone had a similar problem?
有没有人遇到过类似的问题?
Gatsby does not compile to a module, alas, it builds a collection of fully static HTML pages that rehydrate client-side along with initializing the client-side portion of Gatsby (routing, eager page loading, fetching data for new pages for client-side navigation, etc). Gatsby 不会编译为模块,唉,它构建了一个完整的 static HTML 页面的集合,这些页面在初始化 Gatsby 的客户端部分(路由,急切页面加载,为客户端的新页面获取数据导航等)。
You'd be better off porting your Gatsby components and pages into your CRA app or vice versa.您最好将 Gatsby 组件和页面移植到您的 CRA 应用程序中,反之亦然。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.