"use strict";

function _react() {
  const data = _interopRequireDefault(require("react"));

  _react = function _react() {
    return data;
  };

  return data;
}

function _babelJest() {
  const data = _interopRequireDefault(require("babel-jest"));

  _babelJest = function _babelJest() {
    return data;
  };

  return data;
}

function _path() {
  const data = require("path");

  _path = function _path() {
    return data;
  };

  return data;
}

function _umiUtils() {
  const data = require("umi-utils");

  _umiUtils = function _umiUtils() {
    return data;
  };

  return data;
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const cwd = process.cwd();
module.exports = _babelJest().default.createTransformer({
  presets: [require.resolve('@babel/preset-typescript'), [require.resolve('babel-preset-umi'), {
    transformRuntime: false // ...(process.env.TARGETS === 'node' ? { targets: { node: 8 } } : {}),

  }]],
  plugins: [[require.resolve('babel-plugin-module-resolver'), {
    alias: {
      // Projects don't need to install react, react-dom and enzyme
      react: (0, _umiUtils().compatDirname)('react/package', cwd, (0, _path().dirname)(require.resolve('react/package.json'))),
      'react-dom': (0, _umiUtils().compatDirname)('react-dom/package', cwd, (0, _path().dirname)(require.resolve('react-dom/package.json'))),
      enzyme: (0, _umiUtils().compatDirname)('enzyme/package.json', cwd, (0, _path().dirname)(require.resolve('enzyme/package.json'))),
      'enzyme-adapter-react-16': (0, _umiUtils().compatDirname)('enzyme-adapter-react-16/package.json', cwd, (0, _path().dirname)(require.resolve('enzyme-adapter-react-16/package.json')))
    }
  }, 'umi-test']]
});