babel / babel-preset-env

PSA: this repo has been moved into babel/babel -->

Home Page:https://github.com/babel/babel/tree/master/packages/babel-preset-env

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to import/export in Node with this?

corysimmons opened this issue · comments

Had a workflow with babel-preset-es2015 and babel-preset-stage-0 but this project seems pretty cool. The only problem is import and export don't work when your target is just "node": "current".

Is there a particular plugin I need to enable this feature? If so, it might be worth adding a mention in the docs (this was the only hiccup I had with this preset).

you can try {"targets": {"node": 7}}

I'm using Node 8.3.0 and have it set to "node": "current" which should target my env's node version.

The only problem is import and export don't work when your target is just "node": "current"

Can you elaborate? What is your .babelrc? Any chance for a small repo that repros the issue?

This preset supports the same module option as the es2015 preset.

I'm functional. Holy crap. I forgot my babel config on my example... it totally works. So sorry for wasting everyone's time. X_X

@corysimmons no worries, glad it works!

Me too, excited to minimize my Babel pipelines. 😺