File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 3434 "node": true
3535 },
3636 "globals": {
37- "expect": true
37+ "expect": true,
38+ "__non_webpack_require__": true
3839 },
3940 "extends": [
4041 "eslint:recommended",
Original file line number Diff line number Diff line change @@ -14,8 +14,14 @@ import config from '../../config';
1414
1515let stats = null ;
1616
17+ // This is a small 'hack' to tell webpack to avoid resolving the below file
18+ // during compilation, since react-loadable.json may or may not exist.
19+ const requireFunc = typeof __webpack_require__ === 'function'
20+ ? __non_webpack_require__
21+ : require ;
22+
1723if ( config . enableDynamicImports ) {
18- stats = require ( '../../react-loadable.json' ) ;
24+ stats = requireFunc ( '../../react-loadable.json' ) ;
1925}
2026
2127export default function handleRender ( req , res ) {
You can’t perform that action at this time.
0 commit comments