I seriously don't understand why i'm facing such issue with React-Loadable while code splitting in create-react-app build. I'm trying to split code via routes and followed the basic rules mentioned in the docs and other places but only the first component chunk is being generated instead all components chunk should get generated. Please suggest your solutions or points at this.
const MainRoute = () => (
<div>
<Switch>
<Route exact path="/" component={LoadableClientLogin} />
<Route exact path="/apply" component = {LoadableApply}/>
<Route exact path="/new_application" component =
{LoadableAddNewApplication}/>
<Route path="*" component={LoadableClientLogin} />
</Switch>
</div>)
Below is the react-loadable component
import React, { Component } from 'react';
import Loadable from 'react-loadable';
const LoadableComponent = Loadable({
loader: () => import(/* webpackChunkName: "clientLogin" */'./index'),
loading: <div>Loading...</div>,
})
export default class LoadableClientLogin extends Component {
render() {
return <LoadableComponent />;
}
}