Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | import type { ValidatedOptions } from "./validation/options";
|
---|
2 | import getTargets from "@babel/helper-compilation-targets";
|
---|
3 |
|
---|
4 | import type { Targets } from "@babel/helper-compilation-targets";
|
---|
5 |
|
---|
6 | export function resolveBrowserslistConfigFile(
|
---|
7 | // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
---|
8 | browserslistConfigFile: string,
|
---|
9 | // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
---|
10 | configFilePath: string,
|
---|
11 | ): string | void {
|
---|
12 | return undefined;
|
---|
13 | }
|
---|
14 |
|
---|
15 | export function resolveTargets(
|
---|
16 | options: ValidatedOptions,
|
---|
17 | // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
---|
18 | root: string,
|
---|
19 | ): Targets {
|
---|
20 | // todo(flow->ts) remove any and refactor to not assign different types into same variable
|
---|
21 | let targets: any = options.targets;
|
---|
22 | if (typeof targets === "string" || Array.isArray(targets)) {
|
---|
23 | targets = { browsers: targets };
|
---|
24 | }
|
---|
25 | if (targets && targets.esmodules) {
|
---|
26 | targets = { ...targets, esmodules: "intersect" };
|
---|
27 | }
|
---|
28 |
|
---|
29 | return getTargets(targets, {
|
---|
30 | ignoreBrowserslistConfig: true,
|
---|
31 | browserslistEnv: options.browserslistEnv,
|
---|
32 | });
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.