Can't seem to setup Autoprefixer with Bud

I’m trying to setup autoprefixer but with no success.

I made a fresh install of Sage 10. I noticed that autoprefixer library is installed on @roots/bud-tailwindcss package.json but it’s never used anywhere. And we’re fine here, you haven’t mentioned that it works out of the box, I just wanted to make some tests to be sure.

So, I’m trying to use the API of @roots/bud-postcss and I add this on bud.config.js:

.postcss.setPlugin('autoprefixer', require.resolve('autoprefixer'))

(Of course the autoprefixer library is installed)

but this doesn’t seem to work. It works just fine for other postcss extensions.

Do you know what may be the problem here?

My test consist on trying .grid, transition-all, bg-gradient-to-tr tailwind classes.

I don’t believe any of those properties need to be prefixed when using the browserlist defined in package.json.

The browserlist extends the Wordpress browserlist, which can be found here.

Testing on both my own setup as well as online here and I am not getting any prefixes added.

You can add additional requirements to your browserlist in package.json should you need to support older browsers.

1 Like

Thanks for the explanation @zzzap!

I completely forget about the browser’s list. It works out of the box without adding autoprefixer again.