webpackwebpack-splitchunks

How to create multiple vendor modules with splitChunks


I have an app with an admin and frontend module. The admin environment is has a single react-router entry point and I don't care too much about chunking here. The front end needs chunking. Every approach I see uses a node_modules based vendor chunk. How do I make sure that that vendor chunk only contains the front-end related modules,and not the admin ones?

Ideally I would like to be able to filter this through the react-router starting point for admin and frontend.


Solution

  • I couldn't solve this easily and in the end just decided to make the jump to Razzle. Other challenges, but at least this works now.