T
T
toxanski2022-02-18 15:37:29
Frontend
toxanski, 2022-02-18 15:37:29

Code splitting in Webpack 5?

Good evening, I encountered such a problem that when migrating from the 4th webpack to the 5th, code splitting breaks.
I can't understand why the 5th webpack divides the chunks so that jquery goes into each chunk, and not into common.js (a common file for all pages).

This is the script built by webpack 4:
620f91a810c00231474885.jpeg

Here's what webpack 5 built:
620f921736055411998658.jpeg

It would make sense to put jquery in common.js, but webpack 5 doesn't think so. Here is the build code:
620f92c5a1c53051516937.jpeg

Can this behavior be fixed?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question