Open jboonmee opened 8 years ago
@jboonmee for require.ensure ([], cb))
, you must activate the patch_require: true
in webpack-isomorphic-tools.js
file and wrap render in client.js:
import { Router, browserHistory, match } from 'react-router';
***
match({ routes: getRoutes(store), history }, (error, redirectLocation, renderProps) => {
ReactDOM.render(
<Provider store={ store } key="provider">
<Router
{ ...renderProps }
render={ props =>
<ReduxAsyncConnect { ...props } helpers={ { client } } filter={ item => !item.deferred } />
}
>
{ getRoutes(store) }
</Router>
</Provider>,
dest
);
});
I've tried to get this (https://github.com/reactjs/react-router/issues/3232 ) to work, but without success. I ran into the following problems.
One curious thing though, when I used the AMD version of require (require([], cb) instead of require.ensure([], cb)), webpack did generated the chunk for the split point. But the routes still didn't work.
Any thoughts?