I have a React app I've build using create-react-app, which uses react-router. When I open the test development view using npm start, everything works perfectly fine. However, when I build the app -- regardless of what I set the homepage field in package.json to -- all I get is a #root div with a react-empty: 1 comment.
My index.js component looks like so:
ReactDOM.render(
(<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={Home} />
<Route path="/news" component={News} />
<Route path="/current" component={Current} />
<Route path="/previous" component={Previous} />
<Route path="/about" component={About} />
<Route path="/enter" component={Enter} />
<Route path="/login" component={Login} />
<Route path="/profile" component={Profile} />
</Route>
</Router>),
document.querySelector('#root')
);
Please let me know if you need to see any more code in order to figure out what's going on. Just to reiterate -- there are no errors showing up whatsoever, either in npm test or the build copy of the app.
homepagefield inpackage.json"? Why you added such a field?create-react-appworks with regards to assets stored at relative paths. Are you familar with the technology I'm talking about?"homepage": "http://mywebsite.com/relativepath"This will let Create React App correctly infer the root path to use in the generated HTML file.