GoogleChromeLabs / webpack-libs-optimizations

Using a library in your webpack project? Here’s how to optimize it
Apache License 2.0
3.37k stars 111 forks source link

Optimization tip for react-router #2

Closed iamakulov closed 6 years ago

iamakulov commented 6 years ago

In #1, we’re working on mentioning babel-plugin-transform-imports which can replace a full library import with imports of specific library parts.

Turns out, this optimization is also applicable to react-router v3: https://github.com/ReactTraining/react-router/blob/v3/docs/guides/MinimizingBundleSize.md. We need to:

Contributions are welcome :–)

kurtextrem commented 6 years ago

This optimization is indeed possible for a lot of libs that split components into their own files (which should be common in React env). For example not only react-bootstrap, but reactstrap too.

kurtextrem commented 6 years ago

While looking at the source, it seems like this optimization should still apply to v4. So I've went ahead and added it in #1 :)

iamakulov commented 6 years ago

While looking at the source, it seems like this optimization should still apply to v4. So I've went ahead and added it in #1 :)

Awesome, thanks!

iamakulov commented 6 years ago

Closed in #1.