Skip to content

Commit 9bd943b

Browse files
committed
feat: only load react-loadable.json when dynamic imports are enabled
1 parent e62a174 commit 9bd943b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/renderer/handler.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ import render from './render';
1010
import routes from 'routes';
1111
import configureStore from 'store';
1212
import App from 'containers/App';
13-
import stats from '../../react-loadable.json';
13+
import config from '../../config';
14+
15+
let stats = null;
16+
17+
if (config.enableDynamicImports) {
18+
stats = require('../../react-loadable.json');
19+
}
1420

1521
export default function handleRender(req, res) {
1622
const initialState = {};

0 commit comments

Comments
 (0)