1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile;
|
---|
7 | exports.resolveTargets = resolveTargets;
|
---|
8 | function _path() {
|
---|
9 | const data = require("path");
|
---|
10 | _path = function () {
|
---|
11 | return data;
|
---|
12 | };
|
---|
13 | return data;
|
---|
14 | }
|
---|
15 | function _helperCompilationTargets() {
|
---|
16 | const data = require("@babel/helper-compilation-targets");
|
---|
17 | _helperCompilationTargets = function () {
|
---|
18 | return data;
|
---|
19 | };
|
---|
20 | return data;
|
---|
21 | }
|
---|
22 | ({});
|
---|
23 | function resolveBrowserslistConfigFile(browserslistConfigFile, configFileDir) {
|
---|
24 | return _path().resolve(configFileDir, browserslistConfigFile);
|
---|
25 | }
|
---|
26 | function resolveTargets(options, root) {
|
---|
27 | const optTargets = options.targets;
|
---|
28 | let targets;
|
---|
29 | if (typeof optTargets === "string" || Array.isArray(optTargets)) {
|
---|
30 | targets = {
|
---|
31 | browsers: optTargets
|
---|
32 | };
|
---|
33 | } else if (optTargets) {
|
---|
34 | if ("esmodules" in optTargets) {
|
---|
35 | targets = Object.assign({}, optTargets, {
|
---|
36 | esmodules: "intersect"
|
---|
37 | });
|
---|
38 | } else {
|
---|
39 | targets = optTargets;
|
---|
40 | }
|
---|
41 | }
|
---|
42 | const {
|
---|
43 | browserslistConfigFile
|
---|
44 | } = options;
|
---|
45 | let configFile;
|
---|
46 | let ignoreBrowserslistConfig = false;
|
---|
47 | if (typeof browserslistConfigFile === "string") {
|
---|
48 | configFile = browserslistConfigFile;
|
---|
49 | } else {
|
---|
50 | ignoreBrowserslistConfig = browserslistConfigFile === false;
|
---|
51 | }
|
---|
52 | return (0, _helperCompilationTargets().default)(targets, {
|
---|
53 | ignoreBrowserslistConfig,
|
---|
54 | configFile,
|
---|
55 | configPath: root,
|
---|
56 | browserslistEnv: options.browserslistEnv
|
---|
57 | });
|
---|
58 | }
|
---|
59 | 0 && 0;
|
---|
60 |
|
---|
61 | //# sourceMappingURL=resolve-targets.js.map
|
---|