babel-plugin-tailwind-components icon indicating copy to clipboard operation
babel-plugin-tailwind-components copied to clipboard

Starter Example

Open muhajirdev opened this issue 5 years ago • 7 comments

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?

muhajirdev avatar Oct 04 '18 14:10 muhajirdev

I can make a PR if you're okay with that

muhajirdev avatar Oct 04 '18 14:10 muhajirdev

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.

bradlc avatar Oct 04 '18 16:10 bradlc

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.

muhajirdev avatar Oct 05 '18 07:10 muhajirdev

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'
  }
}

bradlc avatar Oct 05 '18 09:10 bradlc

Also it could be cool to add a section to the readme with links to related repos/packages

bradlc avatar Oct 05 '18 09:10 bradlc

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.

muhajirdev avatar Oct 05 '18 10:10 muhajirdev

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

muhajirdev avatar Oct 05 '18 10:10 muhajirdev