I have a navbar npm package that I import into other projects. It dynamically imports FontAwesome icons based on a JSON config file loaded from a web server at runtime.
When I build the navbar package, the entire FontAwesome library ends up as chunks in the build directory, as I would expect.
When I import that navbar module in another project, that project's build does not include the FontAwesome chunks. So the dynamic import HTTP calls get a 404.
I can't find much about this use case online, possibly because I don't know the terms to look for, possibly because this is a terrible idea in the first place.
How can I get webpack to see that a package has dynamic imports and to copy over the necessary chunks to the build directory?