2024-01-16 21:26:16 +08:00
|
|
|
'use strict';
|
2023-12-18 13:12:25 +08:00
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
value: true
|
|
|
|
});
|
|
|
|
|
2024-01-16 21:26:16 +08:00
|
|
|
exports['default'] = function (api) {
|
2023-12-18 13:12:25 +08:00
|
|
|
var transformImport = (0, _utils.createDynamicImportTransform)(api);
|
2024-01-16 21:26:16 +08:00
|
|
|
|
2023-12-18 13:12:25 +08:00
|
|
|
return {
|
|
|
|
// NOTE: Once we drop support for Babel <= v6 we should
|
|
|
|
// update this to import from @babel/plugin-syntax-dynamic-import.
|
|
|
|
// https://www.npmjs.com/package/@babel/plugin-syntax-dynamic-import
|
|
|
|
manipulateOptions: function () {
|
|
|
|
function manipulateOptions(opts, parserOpts) {
|
|
|
|
parserOpts.plugins.push('dynamicImport');
|
|
|
|
}
|
|
|
|
|
|
|
|
return manipulateOptions;
|
|
|
|
}(),
|
2024-01-16 21:26:16 +08:00
|
|
|
|
|
|
|
|
2023-12-18 13:12:25 +08:00
|
|
|
visitor: {
|
|
|
|
Import: function () {
|
|
|
|
function Import(path) {
|
|
|
|
transformImport(this, path);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Import;
|
|
|
|
}()
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-16 21:26:16 +08:00
|
|
|
var _utils = require('./utils');
|
2023-12-18 13:12:25 +08:00
|
|
|
|
2024-01-16 21:26:16 +08:00
|
|
|
module.exports = exports['default'];
|