I am building an angular app, which contains a single component which depends on a library in my node_modules
. I would like to create a single chunk specifically for the dependency so that my users are able to cache it, as the component may change regularly, but the dependency will only be updated every few weeks (whenever it has an update).
I have tried various splits in my webpack config, which always resulted in either all node_modules
in a single chunk, or the the component and its dependency together in one chunk.
Is there a way to configure webpack to always split a vendor into its own chunk if it is not loaded initially?