babel-plugin-tailwind-components
babel-plugin-tailwind-components copied to clipboard
Starter Example
Hey @bradlc ,
I just made a react starter with this lib. I was struggling integrating this with create-react-app
previously.
Do you think it would be a good idea putting react-tailwind-emotion-starter on readme?
I can make a PR if you're okay with that
Hey @muhajirframe
I think I would prefer to add instructions for Create React App itself. As of version 2.0, released a few days ago, CRA supports Babel macros out-of-the-box (without the need for react-app-rewired
), and I have verified that tailwind.macro
works fine.
Hi, @bradlc . Yeah. that could work too. 👍
Last time I tried with babel macros. It takes the tailwind.js
from root project /talwind.js
. But create-react-app
can only import files within /src
.
And then I try write the config in .babel-plugin-macrosrc.js
, so that the macro import tailwind.js
from /src/tailwind.js
. Which doesn't seems to work too . Also, this config feature is still experimental.
Have you tried that with Create React App 2.0? I tried yesterday and it worked with this babel-plugin-macros.config.js
:
module.exports = {
tailwind: {
config: './src/tailwind.js'
}
}
Also it could be cool to add a section to the readme with links to related repos/packages
Have you tried that with Create React App 2.0? I tried yesterday and it worked with this
babel-plugin-macros.config.js
:module.exports = { tailwind: { config: './src/tailwind.js' } }
Yeah, maybe when I tried that. It wasn't 2.0 yet. I'll give it another try.
Also it could be cool to add a section to the readme with links to related repos/packages
Yeah, I published some lib after using your lib