Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally use babel-preset-node6 rather than babel-preset-es2015 #352

Open
keithmo opened this issue Feb 21, 2017 · 3 comments
Open

Optionally use babel-preset-node6 rather than babel-preset-es2015 #352

keithmo opened this issue Feb 21, 2017 · 3 comments

Comments

@keithmo
Copy link

keithmo commented Feb 21, 2017

It would be awesome if there was a way to install a version of streamline which referenced babel-preset-node6 rather than babel-preset-es2015. This obviously be for Node 6.x installations, of course.

@bjouhier
Copy link
Member

The good news is that you can enable this with a .streamline.json options file:

{
    "babel": {
        "presets": ["babel-preset-node6"]
    }
}

The bad news is that it won't work 😢 . The problem is that the streamline plugin only knows about ES5 AST nodes so it needs to run after babel-plugin-es2015. It generates invalid code for ES6 AST nodes (for example class methods with _ parameter).

It would be possible to enhance the plugin to transform ES6 AST nodes directly but this requires some work.

@keithmo
Copy link
Author

keithmo commented Feb 23, 2017

Aha, good to know. Thanks for the info!

@bjouhier
Copy link
Member

I'm keeping it open because the generated code will be more efficient with latest V8 if streamline targets ES6 rather than ES5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants