Babel not replacing arrow functions

Viewed 8093

I installed babel cli and created a .babelrc file with presets set to es2015. I've also installed the es2015 preset. But when I use the command babel script.js --out-file script-compiled.js and check the output file, I still find arrow function syntax (=>) in the code, and browsers that don't support arrow functions are unable to run my code even though it has been transpiled with babel. What might be going on here? If it matters, the project is using react and I'm using browserify to create app.js, and then passing that file to babel.

Edit: here's an example of code that isn't being properly converted:

  this._accountModel.fetch({
      success: (res) => {
        console.log('success');
      },
      error: () => {
        console.log('error');
      }
    });
1 Answers
Related