no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / devtools / client / debugger / babel.config.js
blob39e979eb9930e36710c817580ab1a902876dd294
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
5 "use strict";
7 /* global __dirname */
9 /**
10  * NOTE: This file does not apply to builds in MC. This config is used for
11  * our Jest tests and for webpack bundle builds.
12  */
13 module.exports = {
14   sourceType: "unambiguous",
15   overrides: [
16     {
17       test: [
18         "./src",
19         "./packages/*/index.js",
20         "./packages/*/src",
21         /[/\\]node_modules[/\\]devtools-/,
22         /[/\\]node_modules[/\\]react-aria-components[/\\]/,
23         "../../shared",
24         "../shared/worker-utils.js",
25       ],
26       presets: [
27         "@babel/preset-react",
28         [
29           "@babel/preset-env",
30           {
31             targets: {
32               browsers: ["last 1 Chrome version", "last 1 Firefox version"],
33             },
34             modules: "commonjs",
35           },
36         ],
37       ],
38       plugins: [
39         "@babel/plugin-proposal-class-static-block",
40         "@babel/plugin-proposal-class-properties",
41         "@babel/plugin-proposal-optional-chaining",
42         "@babel/plugin-proposal-nullish-coalescing-operator",
43         "@babel/plugin-proposal-private-methods",
44         "@babel/plugin-proposal-private-property-in-object",
45         "@babel/plugin-proposal-unicode-sets-regex",
46         [
47           "module-resolver",
48           {
49             alias: {
50               "devtools/client/shared/vendor/react": "react",
51               "devtools/client/shared/vendor/react-dom": "react-dom",
52               "devtools/client/shared/vendor/react-dom-factories":
53                 "react-dom-factories",
54               "devtools/client/shared/vendor/react-prop-types": "prop-types",
55               // Map all require("devtools/...") to the real devtools root.
56               "^devtools\\/(.*)": `${__dirname}/../../\\1`,
57               "^resource://devtools/(.*)": `${__dirname}/../../\\1`,
58             },
59           },
60         ],
61       ],
62       env: {
63         test: {
64           presets: [
65             [
66               "@babel/preset-env",
67               {
68                 targets: {
69                   node: 7,
70                 },
71                 modules: "commonjs",
72               },
73             ],
74           ],
75         },
76       },
77     },
78     {
79       test: ["../shared/components"],
80       plugins: [
81         "@babel/plugin-proposal-class-static-block",
82         "@babel/plugin-proposal-class-properties",
83         "@babel/plugin-proposal-optional-chaining",
84         "@babel/plugin-proposal-nullish-coalescing-operator",
85         "@babel/plugin-proposal-private-methods",
86         "@babel/plugin-proposal-private-property-in-object",
87         "transform-amd-to-commonjs",
88       ],
89     },
90   ],