source: trip-planner-front/node_modules/@babel/core/lib/config/resolve-targets.js

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