debug.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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. if (item.startsWith("transform-")) {
  12. const proposalName = `proposal-${item.slice(10)}`;
  13. if (proposalName === "proposal-dynamic-import" || Object.prototype.hasOwnProperty.call(_plugins, proposalName)) {
  14. item = proposalName;
  15. }
  16. }
  17. if (!support) {
  18. console.log(` ${item}`);
  19. return;
  20. }
  21. let formattedTargets = `{`;
  22. let first = true;
  23. for (const target of Object.keys(filteredList)) {
  24. if (!first) formattedTargets += `,`;
  25. first = false;
  26. formattedTargets += ` ${target}`;
  27. if (support[target]) formattedTargets += ` < ${support[target]}`;
  28. }
  29. formattedTargets += ` }`;
  30. console.log(` ${item} ${formattedTargets}`);
  31. };
  32. exports.logPlugin = logPlugin;
  33. //# sourceMappingURL=debug.js.map