babel-external-helpers.js 1000 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. "use strict";
  2. function _commander() {
  3. const data = _interopRequireDefault(require("commander"));
  4. _commander = function () {
  5. return data;
  6. };
  7. return data;
  8. }
  9. function _core() {
  10. const data = require("@babel/core");
  11. _core = function () {
  12. return data;
  13. };
  14. return data;
  15. }
  16. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  17. function collect(value, previousValue) {
  18. if (typeof value !== "string") return previousValue;
  19. const values = value.split(",");
  20. return previousValue ? previousValue.concat(values) : values;
  21. }
  22. _commander().default.option("-l, --whitelist [whitelist]", "Whitelist of helpers to ONLY include", collect);
  23. _commander().default.option("-t, --output-type [type]", "Type of output (global|umd|var)", "global");
  24. _commander().default.usage("[options]");
  25. _commander().default.parse(process.argv);
  26. console.log((0, _core().buildExternalHelpers)(_commander().default.whitelist, _commander().default.outputType));