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

Babel config is not used for files without .js suffix #9041

Open
ivan-kleshnin opened this Issue Nov 19, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@ivan-kleshnin

ivan-kleshnin commented Nov 19, 2018

Bug Report

Current Behavior

I have a run file which serves as a command dispatcher:

./run doX
./run doY

I use it instead of package.json scripts (for reasons I don't want to describe here).
This scheme served me well until Babel-7.

The Problem

babel.config.js file is ignored when the executable (file) name has no .js suffix.
It doesn't matter which config I use, babel.config.js file is loaded ONLY when the file is named
run.js (or whatever with .js suffix). For run file it fallbacks to default babel configs.

Once again, when I rename file and do:

./run.js doX
./run.js doY

everything's fine, ES6 imports are transpiled, etc.

Environment

  • Babel version(s): [7.1.6]
  • Node/npm version: [10.4.1]
@babel-bot

This comment has been minimized.

Collaborator

babel-bot commented Nov 19, 2018

Hey @ivan-kleshnin! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

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