webpack-encore
webpack-encore copied to clipboard
Code splitting of nested routes for each entry point
Let me share an example to explain my problem:-
I have 3 entry points:-
.addEntry('one', './assets/one/app.js') .addEntry('two', './assets/two/app.js') .addEntry('three', './assets/three/app.js')
Now all these entry points are separate react apps and they have their owned nested route like:-
<Route exact path="/one/1" component={Home} />
<Route exact path="/one/2" component={otherComponent} />
Same goes for other two entry points:-
<Route exact path="/two/1" component={Home} />
<Route exact path="/two/2" component={otherComponent} />
Now lets says for entry one when I hit
/one/1
or
/one/2
for both there is only one bundle one.js is being loaded.
I wanted to further split my chunks as per my nested routes. By using dynamic imports and React Loadable I am able to split chunks:-
one.js
0.js
1.js
but these are being loaded together. All three no matter you hit /one/1 or /one/2.
Originally posted by @abhinav-sendinblue in https://github.com/symfony/webpack-encore/issues/573#issuecomment-538386160
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Could I get a reply or should I close this?
Hey,
I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!