I\'m building an isomorphic application. It is completely built with react -- namely, the html base is also in react.
I have my root html as an app component.
It
Instead of trying to render it in the app, I found the best solution is to pass the webpack assets into the app. This can be either directly through props or through your flux.
That way your code is rendered with a variable. The value of your variable is irrelevant for the build process.
...
var AppTemplate = React.createClass({
displayName: 'AppTemplate',
render: function() {
return (
<html>
<head lang="en">
<title>hello</title>
<link rel="stylesheet" href='/css/style.css' />
</head>
<body>
<RouteHandler {...this.props}/>
<script type='text/javascript' src={this.props.jsFile} />
</body>
</html>
);
}
});
...
module.exports = AppTemplate;
Something like that.
You shouldn't be rendering your full HTML on the client, ever. Your head and everything outside your app div in body should just be sent from the server. That way your problem is solved right away, as your client-side Javascript doesn't need to know what file it lives in, and on the server you can just wait for the stats to be ready.
The ExtendedAPIPlugin adds a __webpack_hash__
variable to your bundle, which might be what you're looking for.