How to map a lazy loaded react component to it's respective chunk?

73 views Asked by At

I am using CRA with React lazy to load my components as part of the Route configuration.

Some of my components can be used in a stand alone way (outside of the CRA index.html file), but to do that I need to know which js/css chunks to load.

Is there a way to find out which chunk contains which component or route after building?

I am also using craco, so if there is a way to configure webpack to output the mappings, that would also help me.

Ideally I would like to edit another file and add the chunk names during the build process, but I don't know where to start on that one.

0

There are 0 answers