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

Use Browserslist config #88

Open
ai opened this issue Nov 26, 2020 · 2 comments
Open

Use Browserslist config #88

ai opened this issue Nov 26, 2020 · 2 comments
Assignees

Comments

@ai
Copy link

ai commented Nov 26, 2020

It will be nice to respect the user’s Browserslist config.

We can do it with code like:

let browserslist = require('browserslist')

const baseBrowsers = browserslist()
const es6 = browserslist('supports es6-module')

const modernBrowsers = baseBrowsers.filter(i => es6.includes(i))
const legacyBrowsers = baseBrowsers.filter(i => !es6.includes(i))
@DanielSchaffer
Copy link
Owner

Hey, this is pretty clever. I like it!

@ai
Copy link
Author

ai commented Dec 10, 2020

I made PR to do this trick #87

With recent Browserslist 4.16, we can do it even more elegant by browserslist config query.

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

No branches or pull requests

2 participants