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

babelrc seems to be ignored #21

Closed
alex3683 opened this issue Jul 10, 2015 · 4 comments
Closed

babelrc seems to be ignored #21

alex3683 opened this issue Jul 10, 2015 · 4 comments

Comments

@alex3683
Copy link

To prevent from trying to compile *.js files, I added a .babelrc file with the following contents:

{
   "only": [ "*.es6" ]
}

This seems to be ignored, as I still get the error message "Transpiled file would overwrite source file. Aborted!" when editing a *.js file (in my case the Gruntfile.js).
In my setup I want all *.es6 files to be compiled to *.js files located next to their according source file.

I had a look at your source code at differently tagged versions and I saw, that reading the babelrc file was dropped starting with version 0.8.0. How is it supposed to work now?

@gandm
Copy link
Owner

gandm commented Jul 10, 2015

.babelrc files aren't ignored. babel-core still reads them as you would expect. The internal scanner was dropped in v0.8.0 for other reasons.

The example you gave above is working - the .babelrc file is read and no transpile is taking place but I'm not responding correctly. This is a bug and I will fix now.

There is an easier way to do what you want. just turn on the Disable When No Babelrc In Path option in the language-babel settings. You don't need any .babelrc file at all then.

@alex3683
Copy link
Author

Ah, okay. Seems I just don't know enough about babel-core :-) Thanks for finding and fixing the real issue.

The Disable When No Babelrc In Path option is not really suitable in my case, as some es6 and plain js sources are mixed within my project (one can argue, whether this is a good idea or not, but that's the way it is ;-))

@gandm gandm closed this as completed in ab9fd59 Jul 10, 2015
@gandm
Copy link
Owner

gandm commented Jul 10, 2015

Hope that works.

@alex3683
Copy link
Author

Indeed, it does. 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