Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor browserslist in package.json for Babel, Autoprefixer, etc. #124

Closed
ethanroday opened this issue Jun 20, 2017 · 7 comments · Fixed by #125
Closed

Honor browserslist in package.json for Babel, Autoprefixer, etc. #124

ethanroday opened this issue Jun 20, 2017 · 7 comments · Fixed by #125
Assignees
Labels
Milestone

Comments

@ethanroday
Copy link
Contributor

Rather than hard-code a list of browsers in babel and webpack configs, it would be great if the CLI just added a default browserslist entry in package.json that the user could then edit. For those of us developing for, say, UC Browser for Android, there's currently no recourse to get the full set of required prefixes other than forking this repo and altering the webpack config manually.

@lukeed
Copy link
Member

lukeed commented Jun 20, 2017

@ethanroday I'm not very familiar with all these config options, but is there a convention for passing specific browser targets for Babel?

I ask because browserlist is an array of browser conditions -- but the babel-preset-env also accepts something like:

require('babel-preset-env')({
  targets: {
    chrome: 52
  },
  browsers: [ 'last 2 versions']
});

Should we even allow targets like that? Do you (personally) care if that's not an option?

Appreciate any insight!

@rkostrzewski
Copy link
Collaborator

This probably can shed some light. Seems like it was just left there and browserslist can handle anything that browser specific targets (i.e. targets: { chrome: ... } }) can (most likely apart from node but we don't have to care).

@lukeed
Copy link
Member

lukeed commented Jun 20, 2017

Yeah, looks like anything can be written as a browser string. I don't personally think there's a need for the additional target keys, but I'm asking just in case.

@developit
Copy link
Member

I like the idea that this gives people a single source of truth for defining their support targets.

@developit developit added this to the 1.2.0 milestone Jun 21, 2017
@alex-shamshurin
Copy link

So does it support .browserlistrc ?

@developit
Copy link
Member

No, only the package.json option.

@reznord
Copy link
Member

reznord commented Aug 26, 2017

for now 😛 (hopefully)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants