main
Last change
on this file since 79a0317 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 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.transformDynamicImport = transformDynamicImport;
|
---|
7 | var _core = require("@babel/core");
|
---|
8 | var _helperModuleTransforms = require("@babel/helper-module-transforms");
|
---|
9 | const requireNoInterop = source => _core.template.expression.ast`require(${source})`;
|
---|
10 | const requireInterop = (source, file) => _core.types.callExpression(file.addHelper("interopRequireWildcard"), [requireNoInterop(source)]);
|
---|
11 | function 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.