Compiler for ESM OC (OpenComponents) templates. This package provides the build/compile step for components using the oc-template-esm template type. It is part of the OpenComponents ecosystem, which enables server-side rendering of composable UI components. Current stable version is 3.0.4, with a release cadence aligned with the OC monorepo. Key differentiator: it specifically handles ESM (ES Module) output, targeting modern bundlers and runtimes. It requires oc-server ^4.0.0 as a peer dependency and ships TypeScript types.
npm install oc-template-esm-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates compiling an ESM OC component with minimal options, showing the async compile function and typical result.
Use await compile(...) or .then() to get the result.
Rename 'componentDir' to 'componentPath' in the options object.
Run npm install oc-template-esm-compiler --save-dev
Use import { compile } from 'oc-template-esm-compiler' instead of require.