new to webpack and react here. I followed this medium article to create code splitting in react router. It seems like it has no effect though because my app still has to load the whole bundle.js file synchronously on the initial page load. Any tips for reducing this load time? bundle.js is 2.2mb in dev but prod is about 400kb at the moment after uglifying it.
Simulating a regular 3G connection on network tab
router.js
export default [
{
path: '/',
component: App,
childRoutes: [
{
path: 'signup',
getComponent(location, cb) {
System.import('./modules/App/components/Authentication/Login.js')
.then(loadRoute(cb))
.catch(errorLoading);
}
}
]
}
]
Try these plugins to reduce your duplicate codes
Deduce plugin will find duplicate files and codes and merge them into single unit. Uglify plugin will uglify your code in production.