-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/WordPress/gutenberg into …
…file-block # Conflicts: # utils/mediaupload.js
- Loading branch information
Showing
154 changed files
with
4,210 additions
and
1,527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
const { isArray, map } = require( 'lodash' ); | ||
const babelPluginTransformReactJSX = require( 'babel-plugin-transform-react-jsx' ); | ||
const babelPresetEnv = require( 'babel-preset-env' ); | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
const babelDefaultConfig = require( '@wordpress/babel-preset-default' ); | ||
|
||
const plugins = map( babelDefaultConfig.plugins, ( plugin ) => { | ||
if ( isArray( plugin ) && plugin[ 0 ] === babelPluginTransformReactJSX ) { | ||
// TODO: It should become the default value when all modules are moved to packages. | ||
return [ babelPluginTransformReactJSX, { pragma: 'createElement' } ]; | ||
} | ||
|
||
return plugin; | ||
} ); | ||
|
||
const babelConfigs = { | ||
main: Object.assign( | ||
{}, | ||
babelDefaultConfig, | ||
{ | ||
babelrc: false, | ||
plugins, | ||
presets: map( babelDefaultConfig.presets, ( preset ) => { | ||
if ( isArray( preset ) && preset[ 0 ] === babelPresetEnv ) { | ||
return [ babelPresetEnv, Object.assign( | ||
{}, | ||
preset[ 1 ], | ||
{ modules: 'commonjs' } | ||
) ]; | ||
} | ||
return preset; | ||
} ), | ||
} | ||
), | ||
module: Object.assign( | ||
{}, | ||
babelDefaultConfig, | ||
{ | ||
babelrc: false, | ||
plugins, | ||
} | ||
), | ||
}; | ||
|
||
function getBabelConfig( environment ) { | ||
return babelConfigs[ environment ]; | ||
} | ||
|
||
module.exports = getBabelConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f07f213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirka we usually rebase the development branches off of
master
instead of merging - this way the history will be a lot cleaner