Skip to content

Sharing defineVars in monorepo #204

Closed Answered by nmn
prc5 asked this question in Q&A
Dec 17, 2023 · 1 comments · 8 replies
Discussion options

You must be logged in to vote

When using npm monorepo features, it should "just work". StyleX relies on Node's require.resolve for compilation, so anything that node understands, StyleX understands. You should ensure that the rootDir is the root of the mono-repo and not one of the packages within.

The current limitations are:

  1. Next.js uses a @/ alias that Typescript and the bundler understands, but Node.js doesn't
  2. pnpm uses symbolic links for packages so while it works, it's less reliable than any of the other package managers.
  3. We want to be able to remove the need for passing in rootDir manually.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@prc5
Comment options

@prc5
Comment options

@talovski
Comment options

@prc5
Comment options

@nmn
Comment options

nmn Dec 18, 2023
Collaborator

Answer selected by nmn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants