mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Don't try to load asset manifest in dev mode
We're not going to use it so don't try to load it since it may not have been built yet.
This commit is contained in:
@@ -2,15 +2,16 @@ import React from 'react';
|
||||
import {renderToString} from 'react-dom/server';
|
||||
|
||||
import App from '../src/components/App';
|
||||
import assetManifest from '../build/asset-manifest.json';
|
||||
|
||||
let assets = assetManifest;
|
||||
let assets;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// Use the bundle from create-react-app's server in development mode.
|
||||
assets = {
|
||||
'main.js': '/static/js/bundle.js',
|
||||
'main.css': '',
|
||||
};
|
||||
} else {
|
||||
assets = require('../build/asset-manifest.json');
|
||||
}
|
||||
|
||||
export default function render() {
|
||||
|
||||
Reference in New Issue
Block a user