Behavior change in --use option in beta #89

wincent opened this Issue Feb 17, 2017 · 2 comments


None yet

2 participants

wincent commented Feb 17, 2017

In moving from 2.6.0 to 3.0.0-beta we found that this old invocation:

postcss --use autoprefixer css/*.css -d dist/

Was bombing out with:

PluginError: Cannot find module 'css/app.css'

Evidently, the first file argument "css/app.css" was being interpreted as an argument to --use and postcss-cli was trying to load it as a plug-in module.

Worked around by switching argument order to:

postcss --use autoprefixer -d dist/ css/*.css

So, we have a workaround for this, but this might be considered a regression so I thought you might like to know about it.

RyanZim commented Feb 17, 2017

@wincent This was an intentional change. In v2, if you wanted to set multiple plugins, you had to do:

postcss <input file> --use postcss-cssnext --use autoprefixer

In v3, you can do:

postcss <input file> --use postcss-cssnext autoprefixer

This should be documented in the release notes and migration guide, though. Thanks for bringing this to my attention.

FWIW, you can also do:

postcss --use postcss-cssnext autoprefixer -- <input file>

if you prefer the files at the end.

@RyanZim RyanZim self-assigned this Feb 17, 2017
RyanZim commented Feb 18, 2017

Docs are fixed.

@RyanZim RyanZim closed this Feb 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment