I'm using webpack's code splitting feature to lazy load components and get a separate chunk.
This is why: you are lazy-loading modules.
In this case it looks like one of two things is going on:
you have an entry settings-diet
that somewhere in its tree requires a file start-personalization
. Rather than the source code of this required file being included in the bundle settings-diet
it is being extracted ("split") out of the main bundle to a separate file. This separate file can then be loaded only when it needs to be, i.e. lazily.
this file contains modules common to both the settings-diet
and start-personalization
entries.
The ~
character indicates that everything on its right has been extracted from whatever is on its left. The character used is configurable via the splitChunks.automaticNameDelimiter
configuration property.
This is the work of the SplitChunksPlugin
:
By default it only affects on-demand chunks, because changing initial chunks would affect the script tags the HTML file should include to run the project.
settings-diet
andstart-personalization
are totally different components, using different routes without any common stuff. That's why I'm wondering why webpack created this file with tilde. Anyway, I will read more about split chunks plugin and try to find the reason. – Jerilynjeritah