debug.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.logPlugin = void 0;
  6. var _helperCompilationTargets = require("@babel/helper-compilation-targets");
  7. var _plugins = require("@babel/compat-data/plugins");
  8. const logPlugin = (item, targetVersions, list) => {
  9. const filteredList = (0, _helperCompilationTargets.getInclusionReasons)(item, targetVersions, list);
  10. const support = list[item];
  11. {
  12. if (item.startsWith("transform-")) {
  13. const proposalName = `proposal-${item.slice(10)}`;
  14. if (proposalName === "proposal-dynamic-import" || hasOwnProperty.call(_plugins, proposalName)) {
  15. item = proposalName;
  16. }
  17. }
  18. }
  19. if (!support) {
  20. console.log(` ${item}`);
  21. return;
  22. }
  23. let formattedTargets = `{`;
  24. let first = true;
  25. for (const target of Object.keys(filteredList)) {
  26. if (!first) formattedTargets += `,`;
  27. first = false;
  28. formattedTargets += ` ${target}`;
  29. if (support[target]) formattedTargets += ` < ${support[target]}`;
  30. }
  31. formattedTargets += ` }`;
  32. console.log(` ${item} ${formattedTargets}`);
  33. };
  34. exports.logPlugin = logPlugin;
  35. //# sourceMappingURL=debug.js.map