Skip to content

Respect browserslist env on config.target if browerslist config extends#15911

Closed
refsz wants to merge 2 commits intowebpack:mainfrom
refsz:fix-browserslist-env
Closed

Respect browserslist env on config.target if browerslist config extends#15911
refsz wants to merge 2 commits intowebpack:mainfrom
refsz:fix-browserslist-env

Conversation

@refsz
Copy link

@refsz refsz commented Jun 4, 2022

What kind of change does this PR introduce?

If the browserslist config references an exported Browserslist like
extends @foo/browserslist-config with configs for two or more environments

module.exports = {
    production: [
        '>= 0.5%',
        'not Explorer <= 11'
    ],
    legacy: [
        '>= 1%',
        'Explorer >= 11'
    ]
}

the environment will not be respected if you set config.target like
config.target = 'browserslist:production'

Did you add tests for your changes?
No

Does this PR introduce a breaking change?
I don't think so

What needs to be documented once your changes are merged?

Nothing

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 4, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: refsz / name: refs (4e0a34c)

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should get production env for production, but it is custom names, so some developer can use prod or other words

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants