We have a multi page React
app and the pages are ASP.NET pages that load the single transpiled entrypoints. We've been doing that fine for a while and the transpiled entries keep getting bigger and bigger in size (understandably).
Now we would like to do code splitting to avoid having 1 single big file. I tried optimization.splitChunks.chunks = 'all'
and webpack split the chunks as expected. The problem I have is I'd need to know which chunks the entrypoints depends on (which I don't since the chunks names seem to be randomly generated) to import using the script
tags. I've heard plugins like HtmlWebpackPlugin
could generate the HTML file that has all the dependencies. However, we're using ASP.NET page that's set up to import only the transpiled entrypoint file.
My question is is there a setting in webpack
that would make the entries to import the chunks they need? Or is there a plugin that could help with that?