diff --git a/babel-preset/configs/main.js b/babel-preset/configs/main.js index 7ba9288c8..1e80c902f 100644 --- a/babel-preset/configs/main.js +++ b/babel-preset/configs/main.js @@ -76,9 +76,6 @@ const getPreset = (src, options) => { ) { plugins.push('transform-react-display-name'); } - if (isNull || src.indexOf('import(')) { - plugins.push(require('../transforms/transform-dynamic-import')); - } if (options && options.dev) { plugins.push('transform-react-jsx-source'); diff --git a/babel-preset/transforms/transform-dynamic-import.js b/babel-preset/transforms/transform-dynamic-import.js deleted file mode 100644 index a402f6bb7..000000000 --- a/babel-preset/transforms/transform-dynamic-import.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2016-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -'use strict'; - -const template = require('babel-template'); - -const buildImport = template('Promise.resolve().then(() => require(ARGS))'); - -const TYPE_IMPORT = 'Import'; - -const plugin = { - inherits: require('babel-plugin-syntax-dynamic-import'), - - visitor: { - CallExpression(path) { - if (path.node.callee.type !== TYPE_IMPORT) { - return; - } - const newImport = buildImport({ARGS: path.node.arguments}); - path.replaceWith(newImport); - }, - }, -}; - -module.exports = plugin;