Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable and force Autoprefixer with Next.js?

I'm trying to enable vendor prefixes with Next.js, but they're not working. I'm using SCSS modules, and tried also with normal CSS but this is not working.

EDIT: I'm using a custom PostCSS file:

module.exports = {
    plugins: [
        "postcss-flexbugs-fixes",
        [
            "postcss-preset-env",
            {
                autoprefixer: {
                    flexbox: true,
                    grid: "autoplace",
                },
                stage: 3,
                features: {
                    "custom-properties": true,
                },
            },
        ],
    ],
};
like image 638
JulSeb42 Avatar asked Nov 07 '25 02:11

JulSeb42


1 Answers

You will just need to adjust the browserslist in your package.json.

{
  "browserslist":[
     ......
  ]

}

Try Visiting here for more info in browserslist: https://github.com/browserslist/browserslist

like image 60
Cris Fandiño Jr. Avatar answered Nov 08 '25 17:11

Cris Fandiño Jr.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!