Reputation: 803
I have 2 applications - one written with CRA and one written with Gatsby. I would like to import the gatsby application into the CRA application. I managed to do it with an iframe, but it is not a solution that satisfies me. Is it possible to load a Gatsby application using the script tag? 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.
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?
Upvotes: 0
Views: 121
Reputation: 80041
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).
You'd be better off porting your Gatsby components and pages into your CRA app or vice versa.
Upvotes: 1