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

Do not change the original file extension #211

Open
nicolo-ribaudo opened this issue Feb 18, 2021 · 0 comments
Open

Do not change the original file extension #211

nicolo-ribaudo opened this issue Feb 18, 2021 · 0 comments

Comments

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Feb 18, 2021

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:

  • .js
  • .cjs
  • .mjs

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:

  1. Add a keepFileExtensions option, that matches @babel/cli's --keep-file-extensions
  2. (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

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

1 participant