Gluon universal package · 1.10.0
@gluonjs/compiler
Source transforms and template locations for Gluon tooling.
Runtimeuniversal
Version1.10.0
LicenseMIT
Public entry points2
Install and start
Install the public package at the same version as the rest of the Gluon train:
npm install @gluonjs/compilerimport {
transformGluonModule,
type GluonTransformResult,
} from '@gluonjs/compiler';
const source = `
import { html } from '@gluonjs/core';
export const ProductName = (name: string) => html\`<h1>\${name}</h1>\`;
`;
const result: GluonTransformResult = transformGluonModule(
source,
'/src/product-name.ts',
{ development: true },
);
console.log(result.templates[0]?.tag); // "html"
console.log(result.diagnostics); // source-located compiler diagnosticsPurpose
Source transforms and template location tracking for Gluon tooling.
Use cases
- Track `html`, `svg`, `css`, and aliased `compose()` tagged templates.
- Produce source maps and decorator transforms for tooling.
- Support downstream Vite and language tooling packages.
Public entry points
Only these package exports are part of the supported public boundary.
Dependencies and peers
Installed dependencies
- @vue/compiler-sfc · runtime dependency
- magic-string · runtime dependency
- typescript · runtime dependency
Peer dependencies
- None
API reference
Open an entry point above for generated symbol documentation and a reviewed example for every public symbol. Application code must import from this package entry point, never from repository source paths.
Scope and limits
- Does not render templates or own runtime application state.
- Does not replace the public component model with a private renderer format.
Related guides
Verified integration notes
- Used by `@gluonjs/vite` and `@gluonjs/language-server`.
- Public export surface includes `.` and `./diagnostics`.