create-react-library icon indicating copy to clipboard operation
create-react-library copied to clipboard

Building Modular Libraries

Open Eskaaa opened this issue 5 years ago • 1 comments
trafficstars

I want to build modular libraries.

This issue is a good description for my problem. https://github.com/transitive-bullshit/create-react-library/issues/63

Unfortunately it was ended because v3 changes CRL . Does anyone have a current example or guidance on how to achieve this goal?

Can you add an example rollup configuration for building modular libraries?

For example:

Multiple imports Right Now-
import { A, B } from 'package';
With Modular Imports -
import A from 'package/A'; 
import B from 'package/B';

^ This approach helps reduce the bundle size, as only the file needed is imported and added to the bundle.

Closing as out of date since the v3 release changes nearly everything about CRL.

Is there any way to achieve what was being discussed in v3?

Eskaaa avatar Jul 14 '20 15:07 Eskaaa

Seconded! I'm working on an icon library that absolutely needs tree-shaking to avoid catastrophic bundle bloat -- hundreds of SVGs when you only need two or three is a non-starter. For now it seems the best course of action is to use v2?

rektdeckard avatar Jul 24 '20 06:07 rektdeckard