Monorepo Next.js Setup #481
Replies: 1 comment
-
|
The StyleX repo itself is an example of how to setup a monorepo. The You should be able to use the same setup for your use-case. The only difference being that your transpilePackages: ['theme', 'ui'],The final moving piece here is turbo repo. Our NextJS setup has some issues which we are working to fix so caching between builds cannot be currently used. We use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I wanted to ask about what the general approach to setting up a StyleX with something like Turborepo and consumption in multiple Next.js applications?
I have a design-system package in my monorepo, that will be consumed by our component library to theme our components. Our component library will then be consumed by our Next.js applications. Currently I see there is a plugin for Next.js, Webpack, Rollup, etc. But i'm a bit unsure about how the best way to author our design-system themes and components for consumption in our Next.js app.
Each of the 2 packages
themeanduiwill have stylex as a dependency for styling. Our Next.js apps will also havestylexas a dependency for styling but also depend onthemeanduipackages. I'm just a bit unsure if there's impact for consumption or what the recommended approach should be.Should I use rollup to build the
themeanduipackages, how should we expose vars, themes, from ourthemespackage for consumption with other packages and Next.js apps?Is there any monorepo examples that I should reference?
For context I currently use
tamaguifor our design system, and it provides a build module@tamagui/buildpurposely built for packaging up a design system as a standalone package that can then be consumed from a next.js application or expo application that is configured with the tamagui babel plugin. Here is a reference to their documentation: https://tamagui.dev/docs/guides/design-systemsBeta Was this translation helpful? Give feedback.
All reactions