Aliases from @stylexjs/babel-plugin does not seem to work #649
Replies: 3 comments 1 reply
-
I looked at the project and StyleX doesn't seem to be configured to resolve aliases. Adding the You have to manually configure StyleX as well. See: https://stylexjs.com/docs/api/configuration/babel-plugin/#aliases An example is in the aliases: {
'@/*': [path.join(__dirname, '*')],
}, NOTE: You'll need to use the full path of the folders. The alternative would be to use a monorepo that Node understands natively. This can be done with the |
Beta Was this translation helpful? Give feedback.
-
I did unless I am missing something. In my babel.config file I have aliases: {
'design-system': path.join(__dirname, 'src/design-system/'),
}, Isn't this correct? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer. I tried it now but I have the same result :(. |
Beta Was this translation helpful? Give feedback.
-
I created a webpack project now and I tried to configure aliases for stylex tokens but I get
It works ok with relative paths. I attached here a small test case in case I do something wrong.
stylex-aliases.zip
All you need is to run
yarn install
and thenyarn build
to be able to reproduce it.Looking forward to your answer,
Adi
Beta Was this translation helpful? Give feedback.
All reactions