4

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

1 Answer 1

6

They are, sort of.

According to the docs, splitting is the action (verb), and chunks are what splitting produces (noun).

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.