Skip to content

The Astro compiler. Written in Go. Distributed as WASM.

License

Notifications You must be signed in to change notification settings

withastro/compiler

Repository files navigation

Astro Compiler

Astro’s Go + WASM compiler.

⚠️ Currently in beta!

Install

npm install @astrojs/compiler

Usage

Note: API will change before 1.0! Use at your own discretion.

import { transform } from '@astrojs/compiler';

const result = await transform(source, {
  site: 'https://mysite.dev',
  sourcefile: '/Users/astro/Code/project/src/pages/index.astro',
  sourcemap: 'both',
  internalURL: 'astro/internal',
});

Contributing

CONTRIBUTING.md