UNPKG

@openshift-console/dynamic-plugin-sdk-webpack

Version:

Provides webpack ConsoleRemotePlugin used to build all dynamic plugin assets.

44 lines (43 loc) 1.39 kB
"use strict"; 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', '@patternfly/react-topology', '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': {}, '@openshift-console/dynamic-plugin-sdk-internal': {}, '@patternfly/react-topology': {}, react: {}, 'react-i18next': {}, 'react-redux': {}, 'react-router': { singleton: false }, // fixes runtime error when both v5-compat and v5 are present 'react-router-dom': {}, 'react-router-dom-v5-compat': {}, redux: {}, 'redux-thunk': {}, }; /** * Retrieve full metadata for the given shared module. */ const getSharedModuleMetadata = (moduleName) => { const { singleton = true, allowFallback = false } = sharedPluginModulesMetadata[moduleName]; return { singleton, allowFallback }; }; exports.getSharedModuleMetadata = getSharedModuleMetadata;