Babelrc · Babel


#1

All Babel API options except the callbacks are allowed (because .babelrc files are serializable JSON).


This is a companion discussion topic for the original entry at https://babeljs.io/docs/usage/babelrc/

#2

I don’t agree with

then it defaults to “development”.

what?! env’s should never default to something. They should default to undefined.


#3

an age old debate, in some cases it’s good to have defaults, others it’s not, in this case I am not sure


#4

See https://github.com/babel/babel/pull/4924


#5

I have a default on stuff like this (I couldn’t help myself). I think it’s a minor technicality to really debate over but to be fair I do think it could cause massive problems and cost hours in debugging in rare and/or rookie situations. So, minor as it may be I think I gotta agree with @kirkstrobeck on this one. Default to undefined and throw the error forcing the developer to specify exactly what environment they intended to be in.

Omit the best case scenario and consider the worst thing that could happen if it defaulted to each of the possible environments including “undefined,” WHILE you believe you are in each of the other environments. In other words, If I’m in my test environment a babel and babel defaults to dev I’m going to be a little confused when things don’t work (same environment but database differences in my specific setup). Ultimately not killer but annoying and that’s just my home setup. a corporate environment would likely have issues of much larger calibre.