summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/babel.config.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /devtools/client/debugger/babel.config.js
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/babel.config.js')
-rw-r--r--devtools/client/debugger/babel.config.js90
1 files changed, 90 insertions, 0 deletions
diff --git a/devtools/client/debugger/babel.config.js b/devtools/client/debugger/babel.config.js
new file mode 100644
index 0000000000..b7aa764535
--- /dev/null
+++ b/devtools/client/debugger/babel.config.js
@@ -0,0 +1,90 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
+
+"use strict";
+
+/* global __dirname */
+
+/**
+ * NOTE: This file does not apply to builds in MC. This config is used for
+ * our Jest tests and for webpack bundle builds.
+ */
+module.exports = {
+ sourceType: "unambiguous",
+ overrides: [
+ {
+ test: [
+ "./src",
+ "./packages/*/index.js",
+ "./packages/*/src",
+ /[/\\]node_modules[/\\]devtools-/,
+ /[/\\]node_modules[/\\]react-aria-components[/\\]/,
+ "../../shared",
+ "../shared/worker-utils.js",
+ ],
+ presets: [
+ "@babel/preset-react",
+ [
+ "@babel/preset-env",
+ {
+ targets: {
+ browsers: ["last 1 Chrome version", "last 1 Firefox version"],
+ },
+ modules: "commonjs",
+ },
+ ],
+ ],
+ plugins: [
+ "@babel/plugin-proposal-class-static-block",
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-optional-chaining",
+ "@babel/plugin-proposal-nullish-coalescing-operator",
+ "@babel/plugin-proposal-private-methods",
+ "@babel/plugin-proposal-private-property-in-object",
+ [
+ "module-resolver",
+ {
+ alias: {
+ "devtools/client/shared/vendor/react": "react",
+ "devtools/client/shared/vendor/react-dom": "react-dom",
+ "devtools/client/shared/vendor/react-dom-factories":
+ "react-dom-factories",
+ "devtools/client/shared/vendor/react-prop-types": "prop-types",
+ // Map all require("devtools/...") to the real devtools root.
+ "^devtools\\/(.*)": `${__dirname}/../../\\1`,
+ "^resource://devtools/(.*)": `${__dirname}/../../\\1`,
+ },
+ },
+ ],
+ ],
+ env: {
+ test: {
+ presets: [
+ [
+ "@babel/preset-env",
+ {
+ targets: {
+ node: 7,
+ },
+ modules: "commonjs",
+ },
+ ],
+ ],
+ },
+ },
+ },
+ {
+ test: ["../shared/components"],
+ plugins: [
+ "@babel/plugin-proposal-class-static-block",
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-optional-chaining",
+ "@babel/plugin-proposal-nullish-coalescing-operator",
+ "@babel/plugin-proposal-private-methods",
+ "@babel/plugin-proposal-private-property-in-object",
+ "transform-amd-to-commonjs",
+ ],
+ },
+ ],
+};