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

Add plugin-transform-modules-commonjs to @babel/register #55

Closed
ulrichb opened this issue Mar 17, 2019 · 4 comments
Closed

Add plugin-transform-modules-commonjs to @babel/register #55

ulrichb opened this issue Mar 17, 2019 · 4 comments

Comments

@ulrichb
Copy link

ulrichb commented Mar 17, 2019

As Node.js nowadays supports every ES 6+ feature necessary for writing idiomatic Gulp4 scripts except ES 6 module imports/exports, it would be cool to automatically add the babel-plugin-transform-modules-commonjs plugin by using the @babel/register options.

This would allow to support Gulp4 style files "out of the box" (okay you still need to install the Babel packages).

But the major benefit would be that you wouldn't need a .babelrc file or clutter your package.json and thus avoid to potentially interfere with other Babel usages in a project.

@phated
Copy link
Member

phated commented Mar 17, 2019

We aren't going to do this. We already support esm, so if you only need modules, just use that instead of bloated babel

@phated phated closed this as completed Mar 17, 2019
@ulrichb
Copy link
Author

ulrichb commented Mar 17, 2019

Oh, I din't know of the .esm.js option. (And actually had to update interpret because of the outdated dependency reference in gulp).

Works great and much faster than Babel.

Maybe it's worth mentioning this on https://gulpjs.com/docs/en/getting-started/javascript-and-gulpfiles.

@phated
Copy link
Member

phated commented Mar 18, 2019

Glad it's faster for you (it is also to-spec instead of an interop layer)

As for docs, we have an issue open at gulpjs/gulp#2278

@ulrichb
Copy link
Author

ulrichb commented Mar 18, 2019

Okay. Thanks!

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

No branches or pull requests

2 participants