question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Embedding CRA created SPA into a bigger CMS

See original GitHub issue

My app should be part of a bigger CMS which has header, navbar, sidebar, footer elements. The app will be just some <div id="root" /> within the main content. I do not really know how to set this up with CRE for development and live deployment?

For development, so far I have just create a rather big index.html in public directory. The index.html includes (hand copied) the header, navbar, sidebar, footer markup as it comes from the CMS and also some of the CMS’ css files. For development it’s ok (we do not change a lot on the CMS right now, so not much to keep in sync).

For putting the app into production (live), I would like to just include the <div id="root" /> into one of the CMS’s content templates and add links to the build CSS and JS files that are under build/static/. Do you think this is the best approach to be taken? Any side-effects I cannot think of at the moment? For instance the index.html for live would need to be cut down to only include the <div id="root" /> and the script/link to include the hashed CSS/JS static files, nothing else. And I would not know how to have a different public/index.html for development and production?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
tuchk4commented, Mar 1, 2017

@tbillington

would be best to eject and add a command like build-watch which does the prod build but on webpack file watch.

You can do this without ejecting. Something like

npm i -g watch
"build-watch: watch node_modules/.bin/react-scripts\ build ./src"
npm run build-watch
1reaction
viankakrisnacommented, Feb 21, 2018

@gaearon this use case can be supported with https://github.com/facebook/create-react-app/pull/4014 and https://github.com/facebook/create-react-app/pull/1588

IMO it’s a missing opportunity to not support this use case out of the box.

Read more comments on GitHub >

github_iconTop Results From Across the Web

2021 HCPCS Application Summary for Biannual 2 ... - CMS
Second Biannual, 2021 HCPCS Coding Cycle. This document presents a summary of each HCPCS code application and CMS' coding decision for each application ......
Read more >
SEO With React: Best Practices and Strategies - Toptal
This article examines what software engineers can do to improve SEO with React, including improvements to website discoverability, speed, and user ...
Read more >
The SPA-CMS Paradox - Adobe Experience Cloud
Design the database with text and input fields. Build versions in multiple languages. Create the rules, run some tests, and you're on to...
Read more >
CRA/HMDA Reporter - FFIEC
Once all the data are cleaned, however, a new disclo- sure report cannot be re-created for the institution. The institution must manually update...
Read more >
Strong Spas: Hot Tubs, Spas, & Hardcover Dura-Shield System
Strong Spas manufactures Hot Tubs in luxury, comfort, and innovative hardcover models that include our patented Dura-Shield system.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found