autoprefixer not applied to input file outside of pwd
macacme opened this issue · 2 comments
description
When using postcss-cli with an input file that resides outside of the current directory, autoprefixer (10.4.2) is not applied. I have experienced this issue with versions 8.3.1 and 9.1.0.
failing command
postcss --verbose --no-map -c postcss.config.js -r /path/to/app.css
succeeding command
postcss --verbose --no-map -c postcss.config.js -r ./app.css
postcss.config.js
'use strict'
module.exports = (ctx) => ({
plugins: {
autoprefixer: {}
}
})
You're not using the -c
option correctly. By default, it searches for postcss.config.js
in the same and parent directories of the input files. This is why it doesn't pick it up when you use another path. To make this work, you need to pass to -c
the directory to look for postcss.config.js
in. Try this:
postcss --verbose --no-map -c . -r /path/to/app.css
Thank you for the quick reply, Ryan! I have learnt a lesson. :)