Skip to content

Commit

Permalink
Include custome JSX pragma support in Babel preset
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Feb 24, 2019
1 parent 3feaa48 commit 6ce31db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
10 changes: 0 additions & 10 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ module.exports = function( api ) {

return {
presets: [ '@wordpress/babel-preset-default' ],
plugins: [
[
'@wordpress/babel-plugin-import-jsx-pragma',
{
scopeVariable: 'createElement',
source: '@wordpress/element',
isDefault: false,
},
],
],
env: {
production: {
plugins: [
Expand Down
1 change: 1 addition & 0 deletions packages/babel-preset-default/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Breaking Change

- Plugin updated to include `@wordpress/babel-plugin-import-jsx-pragma` plugin integration.
- Removed `babel-core` dependency acting as Babel 7 bridge ([#13922](https://github.com/WordPress/gutenberg/pull/13922). Ensure all references to `babel-core` are replaced with `@babel/core` .

## 3.0.0 (2018-09-30)
Expand Down
8 changes: 8 additions & 0 deletions packages/babel-preset-default/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ module.exports = function( api ) {
].filter( Boolean ),
plugins: [
'@babel/plugin-proposal-object-rest-spread',
[
'@wordpress/babel-plugin-import-jsx-pragma',
{
scopeVariable: 'createElement',
source: '@wordpress/element',
isDefault: false,
},
],
[ '@babel/plugin-transform-react-jsx', {
pragma: 'createElement',
} ],
Expand Down

0 comments on commit 6ce31db

Please sign in to comment.