babel-external-helpers.js 874 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. "use strict";
  2. function _commander() {
  3. const data = 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 collect(value, previousValue) {
  17. if (typeof value !== "string") return previousValue;
  18. const values = value.split(",");
  19. if (previousValue) {
  20. previousValue.push(...values);
  21. return previousValue;
  22. }
  23. return values;
  24. }
  25. _commander().option("-l, --whitelist [whitelist]", "Whitelist of helpers to ONLY include", collect);
  26. _commander().option("-t, --output-type [type]", "Type of output (global|umd|var)", "global");
  27. _commander().usage("[options]");
  28. _commander().parse(process.argv);
  29. console.log((0, _core().buildExternalHelpers)(_commander().whitelist, _commander().outputType));