browserslist
browserslist copied to clipboard
[Feature suggestion] Support `package.json` `engines.node` field
Suggestion for Node.js: default to package.json
engines.node
field (if present) instead of last 2 versions
.
Use case: I am writing Node.js libraries using Node 11
syntax, but compiling with Babel in order to support Node >=6
. I am declaring Node.js support with engines.node
. Babel preset-env
uses browserslist
. Currently I need to duplicate the information from engines.node
to a browserslist
configuration file or preset-env
configuration option.
Right now many client-side projects use Browserslist. If we will switch defaults from last 2 versions
to package.engine
all client-sude projects without browsers config will not work in browser.
I understanding your case, but this default will hurt too many users and is not expected behavior for any client-side projects authors.
We need different solution for your problem.
This could be opt-in by using a configuration option.
Do you think this would then be a good feature idea? If you think this is not worth the effort, I'll close the issue.
Thanks for the help!
We can introduce one extra query like package.json node
, but I don't have good idea about query name (it should be short and clear)
Some ideas (not super clear, sorry):
-
used node
-
node in use
-
package node
-
node in package
-
engines node
Another idea:
-
project node version
And project electron version
node version in package.json file
would be the most explicit, but not sure if it's too much long... Probably node in package.json
would be just enought, and also open the door to define the version in other files or locations. Could there be any other file where to define the version used? Maybe in lerna
repos?