OC-Template-Handlebars-Compiler is the compiler module for OpenComponents (OC) that handles compilation of components using the Handlebars templating engine. This package supports both the `oc-template-handlebars` and legacy `handlebars` template types. As part of the OC ecosystem (version 6.7.0), it integrates with the OC registry to compile Handlebars templates into server-rendered components. It is actively maintained by the OpenComponents team and ships TypeScript types. Key differentiator: it is specifically built for OpenComponents' component architecture, unlike standalone Handlebars compilers, and provides seamless integration with OC's server-side rendering pipeline.
npm install oc-template-handlebars-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing compile and getInfo, then compiling a simple Handlebars template with version and handlebars instance.
Update component type to 'oc-template-handlebars' or configure legacy support via options.
Avoid using `getInfo`; rely on other OC APIs for version info.
Always pass handlebars: require('handlebars') in the options object to compile().Ensure your bundler can resolve the main entry (CommonJS) or use a compatible module resolution strategy.
Upgrade Node.js to >=12 and ensure handlebars >=4.0.0 is installed.
Run 'npm install handlebars' in your project.
Change 'import compile from ...' to 'import { compile } from ...'.Use type 'oc-template-handlebars' or enable legacy support by setting options.legacy = true.