Next-plugins: next-sass: how to use post css autoprefixer/flex bug fixes?

Created on 21 Jul 2018  路  2Comments  路  Source: vercel/next-plugins

Hi, I'm struggling to understand how I might implement autoprefixer for use with flex here. I've tried your example steps of configuring next.config.js and add postcss.config.js but it doesn't seem to get picked up.

Do you have a working example?

index.js

import "../styles/main.scss"

main.scss

.container { display: flex; flex-direction: column; flex: 1 1; }

postcss.config.js

module.exports = { plugins: [ // Illustrational require('postcss-easy-import')({prefix: '_'}), require('autoprefixer')({}), require('postcss-flexbugs-fixes') ] }

next.config.js

const withSass = require('@zeit/next-sass') module.exports = withSass({ postcssLoaderOptions: { parser: true, autoprefixer: true } })

This is what I've tried, with no joy.

Most helpful comment

Have you added the browserslist property to package.json? I'm using almost the exact same config as you and autoprefixer started working for me only after I included this:

"browserslist": [
    "last 2 versions",
    "> 1%"
  ]

All 2 comments

Have you added the browserslist property to package.json? I'm using almost the exact same config as you and autoprefixer started working for me only after I included this:

"browserslist": [
    "last 2 versions",
    "> 1%"
  ]

@fiveid thank you! that was it.

Was this page helpful?
0 / 5 - 0 ratings