Tips and Tricks


Using advanced JavaScript features from ECMAScript 6 and 7



provides transformations for the vast majority of ES6 features, and enables them by default.

Since Firefox already fully supports most of these, it's best to configure Babel to ignore them.


  "env": {
    "firefox": {
      "sourceMaps": "inline",
      "blacklist": [

Then, to compile an individual script, simply run:

BABEL_ENV=firefox babel <filename>

Or, to compile every JavaScript file under the directory src and place the compiled files in compiled, copying over non-JavaScript files in the process, run:

BABEL_ENV=firefox babel -Dd compiled src