Skip to content

Commit

Permalink
Build: Assign edit-post library target as editPost
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Feb 8, 2018
1 parent e8ce4b9 commit 29b84ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ function gutenberg_editor_scripts_and_styles( $hook ) {
$script .= <<<JS
window._wpLoadGutenbergEditor = wp.api.init().then( function() {
wp.blocks.registerCoreBlocks();
return wp[ 'edit-post' ].initializeEditor( 'editor', window._wpGutenbergPost, editorSettings );
return wp.editPost.initializeEditor( 'editor', window._wpGutenbergPost, editorSettings );
} );
JS;
$script .= '} )();';
Expand Down
10 changes: 6 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const webpack = require( 'webpack' );
const ExtractTextPlugin = require( 'extract-text-webpack-plugin' );
const WebpackRTLPlugin = require( 'webpack-rtl-plugin' );
const { reduce, escapeRegExp, get } = require( 'lodash' );
const { reduce, escapeRegExp, castArray, get } = require( 'lodash' );
const { basename, dirname } = require( 'path' );

// Main CSS loader for everything but blocks..
Expand Down Expand Up @@ -55,7 +55,7 @@ const entryPointNames = [
'i18n',
'utils',
'data',
'edit-post',
[ 'editPost', 'edit-post' ],
];

const packageNames = [
Expand Down Expand Up @@ -127,8 +127,10 @@ class CustomTemplatedPathPlugin {

const config = {
entry: Object.assign(
entryPointNames.reduce( ( memo, entryPointName ) => {
memo[ entryPointName ] = `./${ entryPointName }/index.js`;
entryPointNames.reduce( ( memo, entryPoint ) => {
entryPoint = castArray( entryPoint );
const [ name, path = name ] = entryPoint;
memo[ name ] = `./${ path }/index.js`;
return memo;
}, {} ),
packageNames.reduce( ( memo, packageName ) => {
Expand Down

0 comments on commit 29b84ba

Please sign in to comment.