Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Using externalHelpersWhitelist and still have a babelHelpers var #165

Closed
Johann-S opened this issue Aug 31, 2017 · 1 comment
Closed

Using externalHelpersWhitelist and still have a babelHelpers var #165

Johann-S opened this issue Aug 31, 2017 · 1 comment

Comments

@Johann-S
Copy link

Johann-S commented Aug 31, 2017

Hi,

When I use the externalHelpersWhitelist option I still have a babelHelpers var created in my generated code but this var is useless.

if you need I can add my .babelrc or my rollup.config.js (or you can find them here : twbs/bootstrap#23735)

IMO it's due to this line : https://github.com/rollup/rollup-plugin-babel/blob/master/src/index.js#L48 which only remove : babelHelpers.

this is the part of my generated code with babelHelpers :

var babelHelpers = {};
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  return typeof obj;
} : function (obj) {
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

var classCallCheck = function (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 < 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 inherits = function (subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  }

  subClass.prototype = Object.create(superClass && superClass.prototype, {
    constructor: {
      value: subClass,
      enumerable: false,
      writable: true,
      configurable: true
    }
  });
  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};

var possibleConstructorReturn = function (self, call) {
  if (!self) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }

  return call && (typeof call === "object" || typeof call === "function") ? call : self;
};
babelHelpers;

those lines aren't relevant :

var babelHelpers = {};
babelHelpers;
@Johann-S Johann-S changed the title Using externalHelpersWhitelist and style have a babelHelper var Using externalHelpersWhitelist and style have a babelHelpers var Aug 31, 2017
@Johann-S Johann-S changed the title Using externalHelpersWhitelist and style have a babelHelpers var Using externalHelpersWhitelist and still have a babelHelpers var Aug 31, 2017
@Johann-S Johann-S mentioned this issue Sep 17, 2017
2 tasks
@Johann-S
Copy link
Author

Closed thanks to twbs/bootstrap#23966

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant