Explain why OccurenceOrderPlugin
Closed this issue ยท 4 comments
TheLarkInn commented
Good q:
Why is OccourenceOrderPlugin a size optimization?๐ It has to do with module ids and topological sorting.
styopdev commented
Great, thanks
What about more formal version?
q: Why the OccurenceOrderPlugin is the part of webpack optimisation. What it has to do with module ids and topological sorting?
a: OccurenceOrderPlugin order the modules and chunks by occurrence. More module occurs - smaller id it has, this technique helps to reduce bundle size.
TheLarkInn commented
Exactlyyyyyyyyyyyy!!!! ๐๐๐๐
TheLarkInn commented
I might elaborate and say because a module is used many times it will be referenced many times with webpack_require(moduleId)