As for webpack to remove the unused modules?

The problem is that the compiled file is very much growing. Maybe someone knows whether webpack ability to remove unused modules from the end of the file?
July 8th 19 at 12:20
2 answers
July 8th 19 at 12:22
Webpack collects what you connect. There are a couple of tips:
1. To connect carefully (for example, instead ofimport _ from lodash, use import func_name from lodash/func_name)

Developers try to optimize imports, so look for such opportunities from other libraries (for example).

2. As you wrote in the question - remove from the bundle (final file script) unused code. This can help, for example, uglifyJS. He needs to cut out all the unused. The exact settings will not result (a list), but I can look at this question

3. To use a Linter, e.g. To run lint on a codebase and remove all the unused (but connected) modules.

p.s. while writing an answer to your question, I came across another webpack-bundle-size-analyzer. He did not use, but might help.
July 8th 19 at 12:24
View this video explained in detail.
You can do an entire screencast to watch.

Find more questions by tags Webpack