[79a0317] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.default = void 0;
|
---|
| 7 | var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
---|
| 8 | const SUPPORTED_MODULES = new Set(["commonjs", "amd", "systemjs"]);
|
---|
| 9 | const MODULES_NOT_FOUND = `\
|
---|
| 10 | @babel/plugin-transform-dynamic-import depends on a modules
|
---|
| 11 | transform plugin. Supported plugins are:
|
---|
| 12 | - @babel/plugin-transform-modules-commonjs ^7.4.0
|
---|
| 13 | - @babel/plugin-transform-modules-amd ^7.4.0
|
---|
| 14 | - @babel/plugin-transform-modules-systemjs ^7.4.0
|
---|
| 15 |
|
---|
| 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 = exports.default = (0, _helperPluginUtils.declare)(api => {
|
---|
| 22 | api.assertVersion(7);
|
---|
| 23 | return {
|
---|
| 24 | name: "transform-dynamic-import",
|
---|
| 25 | manipulateOptions: (_, parser) => parser.plugins.push("dynamicImport"),
|
---|
| 26 | pre() {
|
---|
| 27 | this.file.set("@babel/plugin-proposal-dynamic-import", "7.25.9");
|
---|
| 28 | },
|
---|
| 29 | visitor: {
|
---|
| 30 | Program() {
|
---|
| 31 | const modules = this.file.get("@babel/plugin-transform-modules-*");
|
---|
| 32 | if (!SUPPORTED_MODULES.has(modules)) {
|
---|
| 33 | throw new Error(MODULES_NOT_FOUND);
|
---|
| 34 | }
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
| 37 | };
|
---|
| 38 | });
|
---|
| 39 |
|
---|
| 40 | //# sourceMappingURL=index.js.map
|
---|