Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support PostCSS plugins #5843

Closed
pavinthan opened this issue Nov 17, 2018 · 8 comments
Closed

Add support PostCSS plugins #5843

pavinthan opened this issue Nov 17, 2018 · 8 comments
Labels

Comments

@pavinthan
Copy link
Contributor

pavinthan commented Nov 17, 2018

How to use additional PostCSS plugins like tailwindcss?

plugins: () => [
    require('postcss-flexbugs-fixes'),
    require('postcss-preset-env')({
        autoprefixer: {
            flexbox: 'no-2009',
        },
        stage: 3,
    }),
 ],

Can we extends this to use some other plugins?

@patricklafrance
Copy link

Hi @pavinthan,

CRA doesn't support this use case.

The official recommendation from CRA is to make your own fork and customize PostCSS to your needs.

You can find the documentation here: https://facebook.github.io/create-react-app/docs/alternatives-to-ejecting#docsNav

As an alternative to create a fork, you could use craco and follow this recipe to extends the PostCSS plugins.

As @Timer mentioned in other issues, using craco is very prone to breaking since it's an hacky layer on top of CRA to make it more configurable.

That begin said, at Sharegate all our new apps use CRA + craco and they all extends the PostCSS config to add additional CSS features and PostCSS plugins.

This means that you can be confident that if CRA introduce a change that breaks how craco makes PostCSS configurable we will try to fix it as soon as possible.

Hope it helps!

@pavinthan
Copy link
Contributor Author

pavinthan commented Nov 18, 2018

@patricklafrance Thank you for your great reply It's really helps, but I don't like to overrider CRA, just like use CRA as CRA.

and Tailwind CSS becomes most popular utility-first CSS framework seems 22,833 weekly downloads ( ref: https://www.npmjs.com/package/tailwindcss ) so my suggestion CRA users use Tailwind CSS without extending or customize CRA.

CRA can apply postcss tailwindcss plugin only tailwind.js ( recommenced config file from https://tailwindcss.com/docs/installation#2-create-a-tailwind-config-file ) in root directory

@gaearon may you please have a look and advice on this please? 🙏

@RomainLanz
Copy link

RomainLanz commented Nov 28, 2018

I started to use craco on my application to extend the Webpack configuration and it's working great.

Do you believe it would be a good idea to create a PR in the documentation repository to add it as a wrapper for people who want to extend the CRA configuration without ejecting their app?

@pavinthan
Copy link
Contributor Author

Thanks @RomainLanz but I don't like to override CRA
and I have already created a PR #5893 to add this support but It's rejected 😢

@stale
Copy link

stale bot commented Dec 29, 2018

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Dec 29, 2018
@pavinthan
Copy link
Contributor Author

Any update on this guys?

@stale stale bot removed the stale label Jan 2, 2019
@stale
Copy link

stale bot commented Feb 7, 2019

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Feb 7, 2019
@pavinthan
Copy link
Contributor Author

I'm closing this issue with 💔because no response 😢 but waiting to see this in future.

@lock lock bot locked and limited conversation to collaborators Feb 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants