Open ericandrewscott opened 1 month ago
FWIW, we did this by adding every component to our figma.config.json
. It's not elegant, but it works.
Hey @ericandrewscott, glad you found a workaround but agreed this isn't ideal.
In your .figma.tsx
file are you using import { Button } from '@namespace/react-core'
or import { Button } from '@namespace/react-core/button'
?
We have our config file set up to rename the import from our specific package, eg:
import { Button } from '@namespace/react-core';
BUT, we can't account for our customers properly implementing tree-shaking of our library, so we'd like to enable dynamic import subpaths, eg:
import { Button } from '@namespace/react-core/button';
This would ensure that the bundle sizes for anyone importing components from our library stay as small as possible. We also can't count on them using the ESM versions of our components (I know, I know... welcome to modern JS).Is there an easy way to do this dynamically, instead of literally adding every component to our
figma.config.json
, eg:If there was a way to dynamically path the imports, that would help us not
n+1
ourimportPaths
as we add Code Connect files to our components.