aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@babel/core/lib/config/resolve-targets-browser.js
blob: cc4e518029970ed078a1b7827c131408aebf705f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile;
exports.resolveTargets = resolveTargets;

function _helperCompilationTargets() {
  const data = require("@babel/helper-compilation-targets");

  _helperCompilationTargets = function () {
    return data;
  };

  return data;
}

function resolveBrowserslistConfigFile(browserslistConfigFile, configFilePath) {
  return undefined;
}

function resolveTargets(options, root) {
  let targets = options.targets;

  if (typeof targets === "string" || Array.isArray(targets)) {
    targets = {
      browsers: targets
    };
  }

  if (targets && targets.esmodules) {
    targets = Object.assign({}, targets, {
      esmodules: "intersect"
    });
  }

  return (0, _helperCompilationTargets().default)(targets, {
    ignoreBrowserslistConfig: true,
    browserslistEnv: options.browserslistEnv
  });
}