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.

idea: browserslist for npm packages

See original GitHub issue

The current implementation of browserslist good fit for applications, but is it a good fit for libraries?

I’m thinking out loud. https://github.com/ai/browserslist/issues/75 wants to add node.js support. Same time there is engines in package.json. Should engines directive allow to list browsers?

Like:

{
  "engines": {
    "Firefox": "> 20",
    "not ie": "<= 8"
  }
}

Can this information be used by browserslist to verify that all required packages met application browser requirements?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
michael-ciniawskycommented, Dec 26, 2017

Unofficial, but the widely used package.browser (version of the package transpiled/written with changes for browser usage) property would also be nice to ‘support’ as mixture of package.engines && browserslist somehow 😃. Though this is not really browserslist issue 🙃

{
   name: "",
   version: "",
   module: 'path/to/esm.js', // (Source Code)
   // e.g babel-preset-env (targets via browerslist)
   main: 'path/to/cjs.js', // engines.node 
   browser: 'path/to/browser.js', // engines.browsers
   engines: {                                                                                        
     node: ">= 4",
     browsers: { 
        ...list
     }
  }
}
0reactions
jskrzypekcommented, Dec 27, 2017

The pkg.browser field should definitely be unofficially ‘specced’ by some entity and at best officially by npm

@michael-ciniawsky FWIW there’s already this: https://github.com/defunctzombie/package-browser-field-spec

Read more comments on GitHub >

github_iconTop Results From Across the Web

browserslist-generator - npm
A library that makes generating and validating Browserslists a breeze!. Latest version: 1.0.66, last published: 8 months ago.
Read more >
browserslist - npm
Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset. Latest version: 4.21.4, ...
Read more >
browserslist-useragent - npm
A utility to match a browselist query to browser user agents. Latest version: 4.0.0, last published: 2 months ago.
Read more >
browserslist-config-terra - npm
Browserslist is a library to share a browsers list between different front-end tools, like Autoprefixer, Eslint, and Stylelint. Valid ...
Read more >
@nodecraft/browserslist-config - npm
Start using @nodecraft/browserslist-config in your project by running `npm i ... "Browserslist is a Good Idea" (blog post by @chriscoyier) ... package.json.
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