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 Jan 28, 2019
1 parent acb42fa commit e7f5447
Show file tree
Hide file tree
Showing 3 changed files with 14 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
6 changes: 6 additions & 0 deletions packages/babel-preset-default/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 4.0.0 (Unreleased)

## Braking change

- Plugin updated to include `@wordpress/babel-plugin-import-jsx-pragma` plugin integration.

## 3.0.0 (2018-09-30)

## Breaking Change
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 e7f5447

Please sign in to comment.