A synchronous wrapper around the @astrojs/compiler, enabling synchronous processing of Astro files. Current stable version is 1.1.1. Maintained actively with regular releases. Key differentiator: unlike the official compiler which is async-only, this package provides a sync API for use in environments where async is inconvenient, such as certain build tools or scripts. Requires @astrojs/compiler >=0.27.0 as a peer dependency and Node.js ^18.18.0 || >=20.9.0. Ships TypeScript definitions.
npm install astrojs-compiler-syncNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to synchronously parse and transform Astro code using the sync wrapper.
Upgrade Node.js to ^18.18.0 or >=20.9.0.
Update @astrojs/compiler to >=0.27.0 (e.g., npm install @astrojs/compiler@latest).
Update to v1.1.0 or later.
Update to >=0.3.3.
Update to v1.1.1 to avoid potential issues with CJS bundlers.
Use dynamic import() or convert to ESM and use import statements.
Run npm install @astrojs/compiler@>=0.27.0.
Use import { parse } from 'astrojs-compiler-sync'.