Files
firefox/devtools/client/debugger/babel.config.js
T
Nicolas Chevobbe b8fe80ec27 Bug 1599135 - Expose all Reps file. r=jlast.
This allows consumers to directly require a single Rep file
if needed (e.g. the inspector only needs elementNode or textNode).
In order to make this work, the requires for react-dom-factories
and prop-types needed to be changed to the in-tree modules.
We also needed to modified the reps jest config, as well as the
babel config so we can run tests and still generate the reps bundle.
Finally, the dom-node-constants is modified to not use define as
it's not used as an AMD module.

Differential Revision: https://phabricator.services.mozilla.com/D54680
2019-11-27 07:07:30 +00:00

68 lines
1.8 KiB
JavaScript

/* 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/>. */
/**
* 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[/\\]/,
],
presets: [
"@babel/preset-react",
[
"@babel/preset-env",
{
targets: {
browsers: ["last 1 Chrome version", "last 1 Firefox version"],
},
modules: "commonjs",
},
],
],
plugins: [
"@babel/plugin-transform-flow-strip-types",
"@babel/plugin-proposal-class-properties",
[
"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`,
},
},
],
],
env: {
test: {
presets: [
[
"@babel/preset-env",
{
targets: {
node: 7,
},
modules: "commonjs",
},
],
],
},
},
},
],
};