Issues with twin.macro in a monorepo where Storybook is at the root #657
Unanswered
ashleynexvelsolutions
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hey there, I think this is just a config issue as I didn't have too many troubles getting the first repo (https://github.com/ashleynexvelsolutions/twin-macro-monorepo-with-storybook-broken) working. // packages/Button/babel-plugin-macros.config.js
module.exports = {
twin: {
- config: '../../tailwind.config.js',
preset: "emotion",
},
}; Then remove your cache ( |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use twin.macro in a component library. It's a monorepo setup with the .storybook folder at the root. I seem to be having issues accessing my custom values in tailwind.config.js. Inside each of the packages I've got babel-plugin-macros.config.js. When the config is like this, Storybook doesn't pick up my custom colors & fails to build. But I'm able to build the packages just fine with
npm run build
.Minimal repro on GitHub: https://github.com/ashleynexvelsolutions/twin-macro-monorepo-with-storybook-broken
When the config file is like this, Storybook runs just fine. However, when I run
npm run build
, Rollup doesn't pick up the custom colors & fails to build the packages.Minimal repro on GitHub: https://github.com/ashleynexvelsolutions/twin-macro-monorepo-with-rollup-broken
In each scenario, I'm getting the same error.
Then it proceeds to list Tailwind defaults, like text-white, text-gray-300, etc.
I'm sure it's probably a configuration issue on my end somewhere, and not actually an issue with the twin.macro package. Any guidance would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions