Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User live reload development server from external application #4210

Closed
sethreidnz opened this issue Mar 25, 2018 · 1 comment
Closed

User live reload development server from external application #4210

sethreidnz opened this issue Mar 25, 2018 · 1 comment
Labels

Comments

@sethreidnz
Copy link

Is this a bug report?

No

Concept

I have a site where I would like to use create-react-app, it basically is perfect for what I need. However the issue is that I need to load the React app from within a legacy application that is going to render all a lot of the HTML for the site. I am trying to do this by doing some code splitting and having specific divs to load specific components. Somewhat like so:

const dashboardMountNode = document.getElementById('react_dashboard');
if (dashboardMountNode) {
  import("./client/Dashboard").then(({ default: Dashboard }) => {
    ReactDOM.render(<Dashboard />, dashboardMountNode);
  });
}

const wizardMountNode = document.getElementById('wizard');
if (wizardMountNode) {
  import("./client/Wizard").then(({ default: Wizard }) => {
    ReactDOM.render(<Wizard />, wizardMountNode);
  });
}

This works great, however if I load the development server from say another host running under a different URL such as say someurl.local in a script tag like:

<script src="http://localhost:3000/bundle.js"></script>

But then my chunks get loaded from the someurl.local host not the correct one to find them. I'm wondering if its possible to get around this or this just a crazy idea?

Thanks in advance!

@stale
Copy link

stale bot commented Nov 2, 2018

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the stale label Nov 2, 2018
@Timer Timer closed this as completed Nov 2, 2018
@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants