Reputation: 1187
I've seen webpack articles discussing code splitting and other articles discussing chunking. Aren't they the same thing?
Code splitting is one of the most compelling features of webpack. This feature allows you to split your code into various bundles which can then be loaded on demand or in parallel. It can be used to achieve smaller bundles and control resource load prioritization which, if used correctly, can have a major impact on load time.
There are three general approaches to code splitting available:
Entry Points: Manually split code using entry configuration.
Prevent Duplication: Use the CommonsChunkPlugin to dedupe and split chunks.
Dynamic Imports: Split code via inline function calls within modules. Webpack documentation
Upvotes: 4
Views: 504
Reputation: 1209
They are, sort of.
According to the docs, splitting is the action (verb), and chunks are what splitting produces (noun).
Upvotes: 6