create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Is there any way to disable autoprefixer in development?

Open renannobile opened this issue 7 years ago • 3 comments

Hey there,

I've been using CRA for some time now and it really provides everything I need for the moment (it's mostly a React study project).

That said, is there a way to disable autoprefixer just for development env? I've seen some questions related to autoprefixer and PostCSS, but they said that ejecting was the way to go. I don't want to eject so if there's no way to do this without ejecting, I'll just forget about it.

Thank you

renannobile avatar Jan 19 '19 21:01 renannobile

May I ask what the use case is?

But yes, if you edit your package.json:

  "browserslist": {
    "production": [
      <existing entries>
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version"
    ]
  }

Setting development to "last 1" is basically telling autoprefixer to not prefix anything.

Timer avatar Jan 20 '19 01:01 Timer

Hey there, thanks for the tip.

I want to do this because it annoys me to debug CSS on Chrome and see all the prefixed props. Not a big deal actually, just a little QoL improvement.

renannobile avatar Jan 20 '19 15:01 renannobile

Did the tip above work for you?

Timer avatar Jan 20 '19 21:01 Timer