You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
838 B

4 years ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports["default"] = function (api) {
  6. var transformImport = (0, _utils.createDynamicImportTransform)(api);
  7. return {
  8. // NOTE: Once we drop support for Babel <= v6 we should
  9. // update this to import from @babel/plugin-syntax-dynamic-import.
  10. // https://www.npmjs.com/package/@babel/plugin-syntax-dynamic-import
  11. manipulateOptions: function () {
  12. function manipulateOptions(opts, parserOpts) {
  13. parserOpts.plugins.push('dynamicImport');
  14. }
  15. return manipulateOptions;
  16. }(),
  17. visitor: {
  18. Import: function () {
  19. function Import(path) {
  20. transformImport(this, path);
  21. }
  22. return Import;
  23. }()
  24. }
  25. };
  26. };
  27. var _utils = require("./utils");
  28. module.exports = exports["default"];