web 3d图形渲染器
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.

50 lines
1.4 KiB

  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 _pluginSyntaxDynamicImport = _interopRequireDefault(require("@babel/plugin-syntax-dynamic-import"));
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9. const SUPPORTED_MODULES = ["commonjs", "amd", "systemjs"];
  10. const MODULES_NOT_FOUND = `\
  11. @babel/plugin-proposal-dynamic-import depends on a modules
  12. transform plugin. Supported plugins are:
  13. - @babel/plugin-transform-modules-commonjs ^7.4.0
  14. - @babel/plugin-transform-modules-amd ^7.4.0
  15. - @babel/plugin-transform-modules-systemjs ^7.4.0
  16. If you are using Webpack or Rollup and thus don't want
  17. Babel to transpile your imports and exports, you can use
  18. the @babel/plugin-syntax-dynamic-import plugin and let your
  19. bundler handle dynamic imports.
  20. `;
  21. var _default = (0, _helperPluginUtils.declare)(api => {
  22. api.assertVersion(7);
  23. return {
  24. name: "proposal-dynamic-import",
  25. inherits: _pluginSyntaxDynamicImport.default,
  26. pre() {
  27. this.file.set("@babel/plugin-proposal-dynamic-import", "7.13.8");
  28. },
  29. visitor: {
  30. Program() {
  31. const modules = this.file.get("@babel/plugin-transform-modules-*");
  32. if (!SUPPORTED_MODULES.includes(modules)) {
  33. throw new Error(MODULES_NOT_FOUND);
  34. }
  35. }
  36. }
  37. };
  38. });
  39. exports.default = _default;