{"id":26029,"library":"oc-statics-compiler","title":"oc-statics-compiler","description":"OC-Statics-Compiler is a generic module for processing static assets in OpenComponents templates. Current version 3.0.1 ships TypeScript types and is intended for use with the OpenComponents ecosystem. Release cadence is low; maintained primarily by the OpenComponents team. Differentiators are its tight integration with the OC registry and its statics processing pipeline. Not intended for standalone use outside of OC-based projects.","status":"active","version":"3.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/opencomponents/base-templates","tags":["javascript","oc","opencomponents","typescript"],"install":[{"cmd":"npm install oc-statics-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add oc-statics-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add oc-statics-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v3; CommonJS require will fail.","wrong":"const ocStaticsCompiler = require('oc-statics-compiler')","symbol":"default","correct":"import ocStaticsCompiler from 'oc-statics-compiler'"},{"note":"processStatics is a named export, not default.","wrong":"import processStatics from 'oc-statics-compiler'","symbol":"processStatics","correct":"import { processStatics } from 'oc-statics-compiler'"},{"note":"TypeScript type export, use 'import type' to avoid runtime overhead.","wrong":"import { StaticsConfig } from 'oc-statics-compiler'","symbol":"StaticsConfig","correct":"import type { StaticsConfig } from 'oc-statics-compiler'"}],"quickstart":{"code":"import ocStaticsCompiler from 'oc-statics-compiler';\n\nconst result = ocStaticsCompiler.process({\n  componentName: 'my-component',\n  version: '1.0.0',\n  statics: ['style.css', 'script.js']\n});\n\nconsole.log(result);\n// Output: processed statics object with resolved paths","lang":"typescript","description":"Shows how to import the default export and use process() to compile static asset paths."},"warnings":[{"fix":"Use import instead of require; update your project to ESM with type: 'module' in package.json.","message":"v3 changed to ESM-only; require() throws error.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use default export's process() method instead.","message":"processStatics() function deprecated in v2.5.0, removed in v3.","severity":"deprecated","affected_versions":">=2.5.0 <3.0.0"},{"fix":"Upgrade to v3.0.1 or use // @ts-ignore if type not found.","message":"StaticsConfig type may require explicit import; not exported from index.d.ts in some versions.","severity":"gotcha","affected_versions":"<=2.4.0"},{"fix":"Use Node.js v14 or later.","message":"Node.js v10 and v12 support dropped in v3.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install oc-statics-compiler' or 'yarn add oc-statics-compiler'.","cause":"Package not installed or missing in node_modules.","error":"Cannot find module 'oc-statics-compiler'"},{"fix":"Switch to ESM with 'import ocStaticsCompiler from 'oc-statics-compiler'' or downgrade to v2.x.","cause":"Using CommonJS require() with ESM-only package v3+.","error":"require() of ES Module not supported"},{"fix":"Ensure you import the correct symbol: import ocStaticsCompiler from 'oc-statics-compiler' and check that version is >=3.0.0.","cause":"Using default import but the default export is not a function; possibly wrong import or outdated version.","error":"TypeError: ocStaticsCompiler.process is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}