oc-external-dependencies-handler

raw JSON →
1.1.0 verified Sat Apr 25 auth: no javascript

OC (OpenComponents) external dependencies handler for webpack. Version 1.1.0 is current and stable. This package is a small utility within the OC ecosystem, designed to manage external dependencies in webpack configurations for OpenComponents. It has TypeScript definitions included. Release cadence is low, tied to OC base-templates updates. Differentiators: tightly coupled with OC's component model, not a general-purpose webpack plugin.

error TypeError: Cannot destructure property 'handler' of 'require(...)' as it is undefined.
cause Destructuring default export in CommonJS.
fix
Use const handler = require('oc-external-dependencies-handler').
error Module not found: Error: Can't resolve 'oc-external-dependencies-handler'
cause Package not installed or missing in dependencies.
fix
Run npm install oc-external-dependencies-handler.
gotcha Package is part of OC ecosystem; ensure you are using it with OpenComponents.
fix Verify you have '@oc/core' and proper component structure.
gotcha Default export only; named exports do not exist.
fix Use `import handler from 'oc-external-dependencies-handler'`.
npm install oc-external-dependencies-handler
yarn add oc-external-dependencies-handler
pnpm add oc-external-dependencies-handler

Shows how to import and use the handler to set webpack externals for OC components.

import handler from 'oc-external-dependencies-handler';

const webpackConfig = {
  externals: handler(['react', 'react-dom'])
};

export default webpackConfig;