Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Auto detect for node #9

Closed
hzoo opened this issue Sep 24, 2016 · 10 comments
Closed

Auto detect for node #9

hzoo opened this issue Sep 24, 2016 · 10 comments

Comments

@hzoo
Copy link
Member

hzoo commented Sep 24, 2016

babel/babel#3476 (comment)

Would be super nice if it could just adhere to what's in the engines field in package.json. That way you wouldn't have to specify anything manually.

Or just determine current node version before running?

@deepsweet
Copy link

Or just determine current node version before running?

https://github.com/rtsao/babel-preset-es2015-node/blob/master/index.js

@hzoo
Copy link
Member Author

hzoo commented Oct 6, 2016

yeah we can use process.version but we still need to specify whether you are compiling node or compiling for other environments

@rtsao
Copy link
Contributor

rtsao commented Oct 6, 2016

What about a special value for node (e.g. {node: "process"}) which infers from process.version?

@AlicanC
Copy link

AlicanC commented Oct 9, 2016

@rtsao great idea. We should support keywords in versions. #23 needs that too.

@shubheksha
Copy link

I'll work on this!

@hzoo
Copy link
Member Author

hzoo commented Oct 11, 2016

Awesome - I'l try to merge something of #19 first to fix merge conflicts merged

And we can even use it on the project itself 😛

@hzoo
Copy link
Member Author

hzoo commented Oct 17, 2016

@shubheksha still able to work on this? no rush though

@hzoo
Copy link
Member Author

hzoo commented Oct 18, 2016

You can do what was in facebook/create-react-app#878 if you use a preset or use a local js file. If you use a package.json/babelrc you won't be able to use javascript in the config so we could have a hardcoded option for this.

so you can specify node: "process" which will be the same as node: parseFloat(process.versions.node)

And maybe process isn't the best option name for this?

@hzoo
Copy link
Member Author

hzoo commented Oct 29, 2016

@shubheksha Let me know if you need any more context/help on this, or if someone else can take this too

@hzoo
Copy link
Member Author

hzoo commented Nov 2, 2016

#35

w/ "node": "current" or "node": true

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

No branches or pull requests

5 participants