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.
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.
Most helpful comment
Have you added the
browserslistproperty to package.json? I'm using almost the exact same config as you and autoprefixer started working for me only after I included this: