Sha256: 5e42056faed9ce39ffbbe5a7fbec56fdb026d8a85d2587ac94c125f3325be794

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

Contents

import type { ValidatedOptions } from "./validation/options";
import getTargets from "@babel/helper-compilation-targets";

import type { Targets } from "@babel/helper-compilation-targets";

export function resolveBrowserslistConfigFile(
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  browserslistConfigFile: string,
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  configFilePath: string,
): string | void {
  return undefined;
}

export function resolveTargets(
  options: ValidatedOptions,
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  root: string,
): Targets {
  // todo(flow->ts) remove any and refactor to not assign different types into same variable
  let targets: any = options.targets;
  if (typeof targets === "string" || Array.isArray(targets)) {
    targets = { browsers: targets };
  }
  if (targets && targets.esmodules) {
    targets = { ...targets, esmodules: "intersect" };
  }

  return getTargets(targets, {
    ignoreBrowserslistConfig: true,
    browserslistEnv: options.browserslistEnv,
  });
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
disco_app-0.16.1 test/dummy/node_modules/@babel/core/src/config/resolve-targets-browser.ts
disco_app-0.15.2 test/dummy/node_modules/@babel/core/src/config/resolve-targets-browser.ts
disco_app-0.18.4 test/dummy/node_modules/@babel/core/src/config/resolve-targets-browser.ts
disco_app-0.18.1 test/dummy/node_modules/@babel/core/src/config/resolve-targets-browser.ts
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/core/src/config/resolve-targets-browser.ts
disco_app-0.14.0 test/dummy/node_modules/@babel/core/src/config/resolve-targets-browser.ts
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@babel/core/src/config/resolve-targets-browser.ts