S
S
Sergey Suntsev2017-07-13 15:05:22
React
Sergey Suntsev, 2017-07-13 15:05:22

How to split a build into parts using webpack?

The service has a role-playing policy and access to certain components is not available to most users, so why load the entire build.
Is it possible to do this through webpack so that the build is broken down into components and when a certain component is rendered, the necessary part of the build is loaded?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
davidnum95, 2017-07-13
@GreyCrew

Can

R
Roman Alexandrovich, 2017-07-13
@RomReed

I think that this is not advisable. When creating a build, JavaScript Minifier creates one file to reduce the amount of space it takes. Of course, there is a crazy idea to try using webpack to force Minifier to compress each file separately and then include the necessary ones. That still dance with a tambourine. Perhaps the gurus will offer something smarter.
https://webpack.github.io/docs/optimization.html
You can generate multiple commons chunks, by selecting the entry chunks. And you can nest commons chunks. (your theme)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question