index.js 932 B

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _helperPluginUtils = require("@babel/helper-plugin-utils");
  7. var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
  8. api.assertVersion(7);
  9. return {
  10. name: "syntax-import-assertions",
  11. manipulateOptions(opts, {
  12. plugins
  13. }) {
  14. for (let i = 0; i < plugins.length; i++) {
  15. const plugin = plugins[i];
  16. if (plugin === "importAttributes") {
  17. plugins[i] = ["importAttributes", {
  18. deprecatedAssertSyntax: true
  19. }];
  20. return;
  21. }
  22. if (Array.isArray(plugin) && plugin[0] === "importAttributes") {
  23. if (plugin.length < 2) plugins[i].push({});
  24. plugin[1].deprecatedAssertSyntax = true;
  25. return;
  26. }
  27. }
  28. plugins.push("importAssertions");
  29. }
  30. };
  31. });
  32. //# sourceMappingURL=index.js.map