source: imaps-frontend/node_modules/@babel/plugin-transform-modules-commonjs/lib/dynamic-import.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 782 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.transformDynamicImport = transformDynamicImport;
7var _core = require("@babel/core");
8var _helperModuleTransforms = require("@babel/helper-module-transforms");
9const requireNoInterop = source => _core.template.expression.ast`require(${source})`;
10const requireInterop = (source, file) => _core.types.callExpression(file.addHelper("interopRequireWildcard"), [requireNoInterop(source)]);
11function transformDynamicImport(path, noInterop, file) {
12 const buildRequire = noInterop ? requireNoInterop : requireInterop;
13 path.replaceWith((0, _helperModuleTransforms.buildDynamicImport)(path.node, true, false, specifier => buildRequire(specifier, file)));
14}
15
16//# sourceMappingURL=dynamic-import.js.map
Note: See TracBrowser for help on using the repository browser.