question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable sharing of browserlist among projects

See original GitHub issue

This 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:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
aicommented, May 8, 2017

@destroyerofbuilds good question about be independent from npm. Maybe use company will look into npm, but if somebody we have real case we will add use file:path/to/config.

1reaction
ghostcommented, May 8, 2017

@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 our babel-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 (the require 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding browserslist support to your project
A lot of the tools in my projects like Autoprefixer, Babel's preset-env and preset-modules use browserslist (yes that's the name, ...
Read more >
share-browserslist-config - npm
Start using share-browserslist-config in your project by running `npm i share-browserslist-config`. There are no other projects in the npm ...
Read more >
What is the significance of browserslist in package.json ...
Why would we want it? · 0.2%: All browsers that have at least 0,2% of global market share · not dead: Exclude browsers...
Read more >
Browserslist
Shared browser compatibility config for popular JavaScript tools like Autoprefixer, Babel, ESLint, PostCSS, and Webpack. Supported by Evil Martians and Cube ...
Read more >
Browser support - Angular
Enabling polyfills with CLI projectslink ... If you create a TypeScript file, make sure to include it in the files property of your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found