Skip to content

Commit

Permalink
Enable debugging info for JSX elements in dev builds and tests
Browse files Browse the repository at this point in the history
Enable the "development" [1] option for the `@babel/preset-react` preset
to enable more helpful warnings/errors from Preact in development
builds.

Note that the configuration added here _replaces_ rather than _augments_
the `@babel/preset-react` config for other builds, so other keys like
"createElement" also need to be specified in both places.

See https://babeljs.io/docs/en/babel-preset-react#development.
  • Loading branch information
robertknight committed Feb 12, 2020
1 parent e279908 commit 26f9fa0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,15 @@
"angularjs-annotate",
"transform-async-to-promises"
],
"ignore": ["**/vendor/*"]
"ignore": ["**/vendor/*"],
"env": {
"development": {
"presets": [
["@babel/preset-react", {
"development": true,
"pragma": "createElement"
}]
]
}
}
}

0 comments on commit 26f9fa0

Please sign in to comment.