title: Extra define with transform-es2015-modules-amd via grunt-babel
body: <p><strong>Input file</strong></p>
  
  <pre><code>import Logger from "logger";
  export default class Greeter {
      constructor(name) {
          this.name = name || '';
          console.log('Hello', name);
      }
  
      notify() {
          console.log('It is my duty to inform you that this JS is ES6!');
      }
  
      getName() {
          Logger.log('Called getName');
  
          return this.name;
      }
  }
  </code></pre>
  
  <p><strong>Output file, via grunt</strong></p>
  
  <pre><code>define([], function () {
      define(['exports', 'logger'], function (exports, _logger) {
          'use strict';
  
          Object.defineProperty(exports, "__esModule", {
              value: true
          });
  
          var _logger2 = _interopRequireDefault(_logger);
  
          function _interopRequireDefault(obj) {
              return obj &amp;&amp; obj.__esModule ? obj : {
                  default: obj
              };
          }
  
          function _classCallCheck(instance, Constructor) {
              if (!(instance instanceof Constructor)) {
                  throw new TypeError("Cannot call a class as a function");
              }
          }
  
          var _createClass = function () {
              function defineProperties(target, props) {
                  for (var i = 0; i &lt; props.length; i++) {
                      var descriptor = props[i];
                      descriptor.enumerable = descriptor.enumerable || false;
                      descriptor.configurable = true;
                      if ("value" in descriptor) descriptor.writable = true;
                      Object.defineProperty(target, descriptor.key, descriptor);
                  }
              }
  
              return function (Constructor, protoProps, staticProps) {
                  if (protoProps) defineProperties(Constructor.prototype, protoProps);
                  if (staticProps) defineProperties(Constructor, staticProps);
                  return Constructor;
              };
          }();
  
          var Greeter = function () {
              function Greeter(name) {
                  _classCallCheck(this, Greeter);
  
                  this.name = name || '';
                  console.log('Hello', name);
              }
  
              _createClass(Greeter, [{
                  key: 'notify',
                  value: function notify() {
                      console.log('It is my duty to inform you that this JS is ES6!');
                  }
              }, {
                  key: 'getName',
                  value: function getName() {
                      _logger2.default.log('Called getName');
  
                      return this.name;
                  }
              }]);
  
              return Greeter;
          }();
  
          exports.default = Greeter;
      });
  });
  </code></pre>
  
  <p><strong>Output file, via CLI</strong></p>
  
  <pre><code>define(['exports', 'logger'], function (exports, _logger) {
      'use strict';
  
      Object.defineProperty(exports, "__esModule", {
          value: true
      });
  
      var _logger2 = _interopRequireDefault(_logger);
  
      function _interopRequireDefault(obj) {
          return obj &amp;&amp; obj.__esModule ? obj : {
              default: obj
          };
      }
  
      function _classCallCheck(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
          }
      }
  
      var _createClass = function () {
          function defineProperties(target, props) {
              for (var i = 0; i &lt; props.length; i++) {
                  var descriptor = props[i];
                  descriptor.enumerable = descriptor.enumerable || false;
                  descriptor.configurable = true;
                  if ("value" in descriptor) descriptor.writable = true;
                  Object.defineProperty(target, descriptor.key, descriptor);
              }
          }
  
          return function (Constructor, protoProps, staticProps) {
              if (protoProps) defineProperties(Constructor.prototype, protoProps);
              if (staticProps) defineProperties(Constructor, staticProps);
              return Constructor;
          };
      }();
  
      var Greeter = function () {
          function Greeter(name) {
              _classCallCheck(this, Greeter);
  
              this.name = name || '';
              console.log('Hello', name);
          }
  
          _createClass(Greeter, [{
              key: 'notify',
              value: function notify() {
                  console.log('It is my duty to inform you that this JS is ES6!');
              }
          }, {
              key: 'getName',
              value: function getName() {
                  _logger2.default.log('Called getName');
  
                  return this.name;
              }
          }]);
  
          return Greeter;
      }();
  
      exports.default = Greeter;
  });
  </code></pre>
  
  <p><strong>.babelrc</strong></p>
  
  <pre><code>{
      "presets": ["es2015"],
      "plugins": ["transform-es2015-modules-amd"]
  }
  </code></pre>
  
  <p>I'm running into this odd behavior where an extra <code>define()</code> is being added to my ES5 source when I do the transformation via the grunt-babel plugin. I've forked the repo and updated babel-core and babel-preset-es2015 to the latest versions and that didn't help.</p>
  
  <p>Digging in to babel-grunt it looks like <code>babel.transformFileSync</code> is used to do the transformation. In the babel-cli package it looks like <code>babel.tranform</code> is used. But <code>babel.transformFileSync</code> just reads a file and passes the contents to <code>babel.tranform</code>.</p>
  
  <p>I feel like I am missing some small configuration option or something somewhere. Can anyone see what I am missing?</p>