Closed bigfanjs closed 6 years ago
Hello, you are right, I'd like to comment on this, we could make each component in a separate module and load all of them into index.js
that way we could do either:
import { Show } from '@moroccan-oss/react-stoon';
and for who ever wants optimized builds:
import Show from '@moroccan-oss/react-stoon/Show';
We know generalized imports blow bundle sizes and increase the script evaluation and compilation time. So, In this issue I am requesting a new feature which helps you specify only the components you need to import.
I think we still end up loading some useless code even with module bundlers like Webpack's best optimization tricks like taking down dead code using tree shaking before we load our code to the browser. But because most of EcmaScript latest features are now available natively in the some browsers. Some people may not even bother bundling up their code and directly start importing their modules.
I thought I would issue this before I start working on it.