Skip to content

Expose the Container and registerContainerType in JS #676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bin/webpack.metaboxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const config = {
entry: {
metaboxes: './packages/metaboxes/index.js'
},
output: {
library: [ 'cf', '[name]' ],
libraryTarget: 'this'
},
externals: {
'react': [ 'cf', 'vendor', 'react' ],
'react-dom': [ 'cf', 'vendor', 'react-dom' ],
Expand Down
2 changes: 2 additions & 0 deletions packages/metaboxes/containers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import './user-meta';
import Container from '../components/container';
import { getContainerType, registerContainerType } from './registry';

export { registerContainerType, Container };

/**
* Registers the containers.
*/
Expand Down
8 changes: 7 additions & 1 deletion packages/metaboxes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ import { addAction } from '@wordpress/hooks';
import './store';
import './fields';
import initializeMonitors from './monitors';
import initializeContainers from './containers';
import { default as initializeContainers, registerContainerType, Container } from './containers';

import isGutenberg from './utils/is-gutenberg';

/**
* Public API
*/
export { registerContainerType, Container };

/**
* Sets the locale data for the package type
*/
Expand Down