Repository navigation
Add --env to the CLI - #1567
Merged
Merged
Add --env to the CLI#1567
--env to the CLI#1567Conversation
ai
reviewed
Nov 16, 2026
| user-select: ms | ||
| ``` | ||
|
|
||
| If your Browserslist config has [environment sections], use `--env` |
Member
There was a problem hiding this comment.
Remove this docs, it is very rare use case to spend docs on it
ai
reviewed
Nov 16, 2026
| 'Usage:\n' + | ||
| ' autoprefixer --info\n' | ||
| ' autoprefixer --info\n' + | ||
| ' autoprefixer --info --env production\n' |
Member
There was a problem hiding this comment.
The same, remove, we don't need to promote this case
Contributor
Author
|
Both removed — the README section is gone, and the I left the one-line entry in the Options list so |
Member
|
Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
autoprefixer --infoalways reads the default Browserslist section, so there was no way to inspect a specific environment short of settingBROWSERSLIST_ENV. This adds--env, passed straight through to the existingenvoption.$ npx autoprefixer --info --env productionBoth
--env NAMEand--env=NAMEwork, anywhere in the argument list. Browserslist's own CLI takes only the=form, but the space-separated one seemed worth accepting too — happy to drop it if you'd rather the two matched exactly. Missing or flag-shaped values exit 1 with a message rather than being silently ignored.Added
test/bin.test.js, which runs the binary against a temp Browserslist config with two sections. There was no test forbin/autoprefixerbefore, so it also covers--versionand the help output.Fixes #1338