Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
841 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 |
|
---|
| 7 | exports['default'] = function (api) {
|
---|
| 8 | var transformImport = (0, _utils.createDynamicImportTransform)(api);
|
---|
| 9 |
|
---|
| 10 | return {
|
---|
| 11 | // NOTE: Once we drop support for Babel <= v6 we should
|
---|
| 12 | // update this to import from @babel/plugin-syntax-dynamic-import.
|
---|
| 13 | // https://www.npmjs.com/package/@babel/plugin-syntax-dynamic-import
|
---|
| 14 | manipulateOptions: function () {
|
---|
| 15 | function manipulateOptions(opts, parserOpts) {
|
---|
| 16 | parserOpts.plugins.push('dynamicImport');
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | return manipulateOptions;
|
---|
| 20 | }(),
|
---|
| 21 |
|
---|
| 22 |
|
---|
| 23 | visitor: {
|
---|
| 24 | Import: function () {
|
---|
| 25 | function Import(path) {
|
---|
| 26 | transformImport(this, path);
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | return Import;
|
---|
| 30 | }()
|
---|
| 31 | }
|
---|
| 32 | };
|
---|
| 33 | };
|
---|
| 34 |
|
---|
| 35 | var _utils = require('./utils');
|
---|
| 36 |
|
---|
| 37 | module.exports = exports['default']; |
---|
Note:
See
TracBrowser
for help on using the repository browser.