DISCLAIMER: I know that this issue has already been proposed and rejected different times.
gulp-babel always renames the file to .js, regardless of the input extension. This was the most reasonable behavior until a few years ago: .js was the only extension for JavaScript.
However, now there are three "official" (supported by Node.js) JavaScript extensions:
and renaming them to .js is undesirable, since they are not interchangeable. I think that this is a good reason to reopen the discussion, and we have two options:
- Add a
keepFileExtensions option, that matches @babel/cli's --keep-file-extensions
- (breaking) Do not support changing the extension, and let users use
gulp-rename
I am aware that there is the gulp-revert-path plugin that undoes Babel's extension change, but it is a workaround and not a proper solution: while a workaround made sense when .js was the only reasonable extension, I think we need a real solution now.
Context: babel/babel#12820
DISCLAIMER: I know that this issue has already been proposed and rejected different times.
gulp-babelalways renames the file to.js, regardless of the input extension. This was the most reasonable behavior until a few years ago:.jswas the only extension for JavaScript.However, now there are three "official" (supported by Node.js) JavaScript extensions:
.js.cjs.mjsand renaming them to
.jsis undesirable, since they are not interchangeable. I think that this is a good reason to reopen the discussion, and we have two options:keepFileExtensionsoption, that matches@babel/cli's--keep-file-extensionsgulp-renameI am aware that there is the
gulp-revert-pathplugin that undoes Babel's extension change, but it is a workaround and not a proper solution: while a workaround made sense when.jswas the only reasonable extension, I think we need a real solution now.Context: babel/babel#12820