Exporting styled-system with design system #1023
-
Hello! First of all thank you so much for this amazing library. The DX is incredible and I can't wait to migrate our design system to Panda. I'm currently doing a POC to promote the idea to switch to Panda. I followed the component library instructions in the docs but I still have some questions. Would it be possible to do Everything is working fine in an app with the This might be only an issue with my POC since I'm using NX with PNPM, with apps and ds in the same repository. In a real world scenario, the ds is separated from the apps monorepo in it's own repo an published to NPM. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
if you only generate 1 outdir for all your packages ( if you have multiple packages each with different config by using |
Beta Was this translation helpful? Give feedback.
if you only generate 1 outdir for all your packages (
import { css , cva, cx } from '@company/ds'
), it should be generated using aconfig.include
that includes all your sources, which is probably not what you wantif you have multiple packages each with different config
include
, you probably want to generate anoutdir
for each of them so that the lightweight JS runtime is not duplicated (css
andcva
function, patterns, recipes, jsx components..) and the css generated matches only theinclude
for that packageby using
emitPackage: true
and re-using the sameoutdir
name for each package, you are simulating (by tricking node resolution tbh) having only 1 import