Enable sharing of browserlist among projects
See original GitHub issueThis project addresses the need to share a browerlist among tools, but I think it’s equally important to be able to share a list among multiple modules. Tools such as stylelint and eslint enable sharing configurations with extends
properties that correlate to the name of a preset installed as a Node.js.
The biggest reason this is useful is that you would typically want to base your supported browsers on the traffic to your website (rather than aggregate traffic to other websites). While you can generate a browserlist from your website stats and use it, it currently looks like you would have to make and update multiple copies of the list. Unless this is something enabled via babel-env-preset or another option. (It’s not apparent to me, but I might be missing it).
Adding a feature that enables a user to have and use a browser list module would make this configuration even more useful than it is already.
e.g. in a package.json
...
"browserlist": {
"extends": "my-browserlist"
}
...
npm install --save-dev browserlist-preset-my-browserlist
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:16 (8 by maintainers)
Top GitHub Comments
@destroyerofbuilds good question about be independent from npm. Maybe
use company
will look intonpm
, but if somebody we have real case we will adduse file:path/to/config
.@ai for the time being that’s probably a good enough solution to help us consolidate our duplicated lists.
We’d probably also look to
require
the same package within ourbabel-preset-ourcompany
package as well.Why I said good enough is that I’d like to, at some point, leverage the
.browserslistrc
file so that we don’t need to maintain the extra layer of indirection (therequire
within a package underneath the application itself), but could just have teams directly specify the browser lists they need to support, and then tools like Babel or Autoprefixer, can just use the.browserslistrc
file directly.So, thank you very much for the idea, and if I remember, I’ll provide feedback on how that approach works out.