entry.js 593 B

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = void 0;
  4. var _utils = require("../utils");
  5. var _default = callProvider => ({
  6. ImportDeclaration(path) {
  7. const source = (0, _utils.getImportSource)(path);
  8. if (!source) return;
  9. callProvider({
  10. kind: "import",
  11. source
  12. }, path);
  13. },
  14. Program(path) {
  15. path.get("body").forEach(bodyPath => {
  16. const source = (0, _utils.getRequireSource)(bodyPath);
  17. if (!source) return;
  18. callProvider({
  19. kind: "import",
  20. source
  21. }, bodyPath);
  22. });
  23. }
  24. });
  25. exports.default = _default;