Registry / web-framework / oc-statics-compiler

oc-statics-compiler

JSON →
library3.0.1jsnpmunverified

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.

npm install oc-statics-compiler
INSTALL
IMPORT
SIG · OC-STATICS-COMPILE
O
oc-statics-compiler
web-frameworkjavascriptv3.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import ocStaticsCompiler from 'oc-statics-compiler'
const ocStaticsCompiler = require('oc-statics-compiler')
ESM-only since v3; CommonJS require will fail.
processStatics
import { processStatics } from 'oc-statics-compiler'
import processStatics from 'oc-statics-compiler'
processStatics is a named export, not default.
StaticsConfig
import type { StaticsConfig } from 'oc-statics-compiler'
import { StaticsConfig } from 'oc-statics-compiler'
TypeScript type export, use 'import type' to avoid runtime overhead.

Shows how to import the default export and use process() to compile static asset paths.

import ocStaticsCompiler from 'oc-statics-compiler'; const result = ocStaticsCompiler.process({ componentName: 'my-component', version: '1.0.0', statics: ['style.css', 'script.js'] }); console.log(result); // Output: processed statics object with resolved paths
Debug
Known issues
breakingv3 changed to ESM-only; require() throws error.
fix
Use import instead of require; update your project to ESM with type: 'module' in package.json.
affects: >=3.0.0
deprecatedprocessStatics() function deprecated in v2.5.0, removed in v3.
fix
Use default export's process() method instead.
affects: >=2.5.0 <3.0.0
gotchaStaticsConfig type may require explicit import; not exported from index.d.ts in some versions.
fix
Upgrade to v3.0.1 or use // @ts-ignore if type not found.
affects: <=2.4.0
deprecatedNode.js v10 and v12 support dropped in v3.
fix
Use Node.js v14 or later.
affects: >=3.0.0
Errors
Common errors & fixes
Cannot find module 'oc-statics-compiler'
Package not installed or missing in node_modules.
fix
Run 'npm install oc-statics-compiler' or 'yarn add oc-statics-compiler'.
require() of ES Module not supported
Using CommonJS require() with ESM-only package v3+.
fix
Switch to ESM with 'import ocStaticsCompiler from 'oc-statics-compiler'' or downgrade to v2.x.
TypeError: ocStaticsCompiler.process is not a function
Using default import but the default export is not a function; possibly wrong import or outdated version.
fix
Ensure you import the correct symbol: import ocStaticsCompiler from 'oc-statics-compiler' and check that version is >=3.0.0.
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
oc-statics-compiler — npm install oc-statics-compiler · libregistry