Universal compiler system for JavaScript code generation in multiple modes (default, build, hydrate). Version 3.2.0 is current stable. Ships TypeScript types. Key differentiator: build/hydrate mode separation for efficient asset compilation vs runtime hydration. Active development. Alternatives like Babel focus on transpilation, while runtime-compiler provides structured build-and-run orchestrations.
npm install runtime-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import and use the config utility functions (isHydrating, onlyBuild) to determine the current compiler mode, and a basic compile example.
Change import from 'import config from 'runtime-compiler/config' to 'import { isHydrating, onlyBuild } from 'runtime-compiler/config'Invoke as functions: if (isHydrating()) instead of if (isHydrating)
Use isHydrating() or onlyBuild() from 'runtime-compiler/config' instead of checking process.env.COMPILER_MODE
Always use the config functions to avoid undefined behavior.
Upgrade to runtime-compiler@>=3.0.0 or import from the main package: import { isHydrating, onlyBuild } from 'runtime-compiler' (if available in your version).Change to if (isHydrating()) to invoke the function.
Use named import: import { compile } from 'runtime-compiler' instead of import compiler from 'runtime-compiler'.No dependency data recorded yet.