-
-
Notifications
You must be signed in to change notification settings - Fork 504
Description
Hey Guys,
I wanna discuss a new feature about module imported/used duplicately.
Actually, I have been working on project optimization for days.
I wanna decrease webpack bundle size, make it fast to load.
So I have looked into the diagram from webpack-bundle-analyzer for hundred times in those days.
This is a great plugin, many thanks to team.
Scenario
In modern web framework like Angular, React, Vue, they all support dynamic routing.
And if we use static import to import same module in some dynamical routers, we may make the bundles "dirty".
As you see below, common.ts is imported twice.
static import & dynamic import.
What I want
For web developer beginners, they have no idea about what kind of bundles they will get in different way of coding.
We have many web developers in company, so I wanna to know: Is there a same problem in my project?
We could imagine if webpack-bundle-analyzer can represent it (highlight them in red or sth.) to us, that would be great!
Not all duplicate modules need to be extracted as individual.
Maybe we can bundle it into main module (app.js), it depends on business and module size etc.
Questions need to discuss
- main module (app.js) may take the most area of diagram. It is hard to find duplicate modules. After hiding main module, it better. Do we need to make a new diagram or component for this?
- How to represent if we have many different duplicate modules. Use different colors ? Maybe a list or table is better ?
Any thoughts or suggestion are welcome.
Thanks

