@openshift-console/dynamic-plugin-sdk-webpack
Version:
Provides webpack ConsoleRemotePlugin used to build all dynamic plugin assets.
42 lines (41 loc) • 1.63 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSharedModuleMetadata = exports.sharedPluginModules = void 0;
/**
* Modules shared between the Console application and its dynamic plugins.
*/
exports.sharedPluginModules = [
'@openshift-console/dynamic-plugin-sdk',
'@openshift-console/dynamic-plugin-sdk-internal',
'react',
'react-i18next',
'react-redux',
'react-router',
'react-router-dom',
'react-router-dom-v5-compat',
'redux',
'redux-thunk',
];
/**
* Metadata associated with the shared modules.
*/
const sharedPluginModulesMetadata = {
'@openshift-console/dynamic-plugin-sdk': { singleton: true, allowFallback: false },
'@openshift-console/dynamic-plugin-sdk-internal': { singleton: true, allowFallback: false },
react: { singleton: true, allowFallback: false },
'react-i18next': { singleton: true, allowFallback: false },
'react-redux': { singleton: true, allowFallback: false },
'react-router': { singleton: true, allowFallback: false },
'react-router-dom': { singleton: true, allowFallback: false },
'react-router-dom-v5-compat': { singleton: true, allowFallback: false },
redux: { singleton: true, allowFallback: false },
'redux-thunk': { singleton: true, allowFallback: false },
};
/**
* Retrieve full metadata for the given shared module.
*/
const getSharedModuleMetadata = (moduleName) => {
const { singleton = false, allowFallback = true } = sharedPluginModulesMetadata[moduleName];
return { singleton, allowFallback };
};
exports.getSharedModuleMetadata = getSharedModuleMetadata;
;