Export Registry
Export/Import formats
The following scenarios are not supported:
Exports that will not be added to the registry
When using an unnamed export, the module cannot be added to the registry, unless that is a wanted behavior on your part, make sure to have names on exports. Examples:
// Will not be added to the registry
export default function () {
return 'anonymous';
};
// Will be added
export default function acme() {
return 'anonymous';
};
// Will not be added to the registry
import Model from './Model';
import PostTypes from './PostTypes';
import Routes from './Routes';
import Store from './Store';
export default {
Model,
PostTypes,
Routes,
Store,
};
// Will be added
import Model from './Model';
import PostTypes from './PostTypes';
import Routes from './Routes';
import Store from './Store';
const extenders = {
Model,
PostTypes,
Routes,
Store,
};
export default extenders;
Supported Exports/Imports across extensions
There are 3 ways you can export modules to be imported from other extensions