Split admin build file with Webpack 2 + React-Router

Ali Sepehri
salamcinema
Published in
1 min readMar 2, 2017

We decided to write an admin part for our web application. To prevent increasing build file size we can write another application for admin section. Writing another application is really crazy idea. There is another solution: partial loading for admin pages (separate build file for admin).
Partial application loading is essential if you want to improve time-to-first-impression in your single page application.

To split your build file per each route you can find many tutorial like this on the Internet. If you are using webpack 1.x.x and you want to migrate to wepack 2 you can use this document.

Okay, why I’m writing this article? Dude! I just need one separate bundle file for admin section not many bundle files per any route.

And here is my react-router file:

--

--