Registry / devops / oc-vite-compiler

oc-vite-compiler

JSON →
library6.0.0jsnpmunverified

OC-Vite-Compiler is an OC (OpenComponents) module that compiles view and server code using Vite. Version 6.0.0 is the latest stable release, with a focus on providing fast builds and HMR for OC components. It integrates Vite's bundling capabilities into the OC ecosystem, enabling ESM and TypeScript support. The package ships TypeScript types and is part of the OpenComponents toolchain. Release cadence is sporadic, tied to OC updates. Key differentiator: leverages Vite for modern, fast development experience versus traditional webpack-based compilers.

npm install oc-vite-compiler
INSTALL
IMPORT
SIG · OC-VITE-COMPILER
O
oc-vite-compiler
devopsjavascriptv6.0.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

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

default
✓ import compiler from 'oc-vite-compiler'
✗ const compiler = require('oc-vite-compiler')
ESM-only package; require() will fail.
ViteCompiler
✓ import { ViteCompiler } from 'oc-vite-compiler'
✗ import ViteCompiler from 'oc-vite-compiler'
Named export, not default.
type ViteCompilerOptions
✓ import type { ViteCompilerOptions } from 'oc-vite-compiler'
✗ import { ViteCompilerOptions } from 'oc-vite-compiler'
Type-only export; use import type to avoid runtime overhead.

Demonstrates compiling an OC component using oc-vite-compiler with options for component path, server, and view files.

import compiler from 'oc-vite-compiler'; const options = { componentPath: './src/components/my-component', server: './src/server.js', view: './src/view.js', viteConfig: {} }; export async function compileComponent() { try { const result = await compiler(options); console.log('Compiled successfully:', result.outputPath); } catch (error) { console.error('Compilation failed:', error); } } compileComponent();
Debug
Known issues
breakingv6 drops support for Node.js < 16.
fix
Upgrade Node.js to 16+.
affects: >=6.0.0
breakingv6 changed default export from object to function.
fix
Update from import compiler from 'oc-vite-compiler/legacy' to new API.
affects: >=6.0.0
deprecatedUsing 'oc-vite-compiler/legacy' path is deprecated since v6.
fix
Use default export directly from 'oc-vite-compiler'.
affects: >=6.0.0 <7.0.0
gotchaVite config must not include 'root' or 'build.outDir' as they are overridden.
fix
Remove 'root' and 'build.outDir' from viteConfig option.
affects: >=1.0.0
gotchaESM-only package: cannot be required() in CommonJS modules.
fix
Use dynamic import() or switch to ESM.
affects: >=6.0.0
Errors
Common errors & fixes
require() of ES Module /path/to/oc-vite-compiler/index.js from /path/to/project/index.js not supported.
Package is ESM-only, cannot be used with require().
fix
Use import statement or dynamic import() in ESM context.
Cannot find module 'oc-vite-compiler/legacy'
Legacy path removed in v6.
fix
Use default import from 'oc-vite-compiler'.
TypeError: compiler is not a function
Importing default incorrectly (e.g., using ViteCompiler named export as default).
fix
Use 'import compiler from 'oc-vite-compiler'' for default export.
Upgrade
Version history
6.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

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